need shell power-off / shutdown command

Questions and mods regarding system management may go here
Forum rules
Please note the disclaimer before modifying your Synology Product.

need shell power-off / shutdown command

Postby Supaman » Fri Feb 16, 2007 3:33 pm

hi,

hibernation did not work correctly, and sometimes i forget to shutdown my box in the evening and it's runnig over night.

i want to write a shutdown command in the cron tab table, can anyone tell me the command to power off the system?

thx,

supa
Synology CS 406 (Firmware 524) with 4x Samsung HD753LJ @Raid-5 | working hibernation
Pinnacle Showcenter 200
Synology Wiki: How to Silence the CubeStation
User avatar
Supaman
Sharp
Sharp
 
Posts: 184
Joined: Sun Nov 12, 2006 5:58 pm
Location: Germany

Postby HarryPotter » Fri Feb 16, 2007 3:55 pm

Have a look at this thread, from page 3 on there was a discussion about power off comands, initialized by NetBoot
*Please do not Private Message me for support questions; leave it on the forum so all members can learn. Thanks!*

DS712+ / DSM 4.2 3211 / 2 x HD204UI (RAID0) / LMS 7.7.2-007
DS110+ / DSM 4.2 3211 / HD154UI
DS408 / DSM 4.0 2228 / 3 x ST31000340AS (RAID0) + 1 x HDS721010KLA330
DS207+ / DSM 3.1.1636 / ST31000340AS + WD5000KS
DS-106x / DSM 4.0 2228 (from DS108j) /

2 Squeezebox 3 + Boom
Rapsody N35

APC Smart UPS SUA750i
User avatar
HarryPotter
Honorary Moderator
Honorary Moderator
 
Posts: 12332
Joined: Mon Oct 23, 2006 12:48 pm
Location: Switzerland

Postby Supaman » Sat Feb 17, 2007 9:24 am

thx a lot harry, i have added this line

Code: Select all
0   1   *   *   *   root   /usr/syno/bin/wget http://localhost:5000/reboot.cgi?opt=shutdown&type=healthy


to /etc/crontab and it works fine. now every day the system does a shutdown at 1 am
Synology CS 406 (Firmware 524) with 4x Samsung HD753LJ @Raid-5 | working hibernation
Pinnacle Showcenter 200
Synology Wiki: How to Silence the CubeStation
User avatar
Supaman
Sharp
Sharp
 
Posts: 184
Joined: Sun Nov 12, 2006 5:58 pm
Location: Germany

Postby Laurence Benjamin » Sun Apr 29, 2007 6:10 pm

Hi,

You've probably got this all sorted out now but I just thought I'd share my little hack for getting some zz's with the DS in my bedroom.

Reeboot script:

#!/bin/sh
/sbin/reboot


Sleep script:

#!/bin/sh
/usr/syno/etc.defaults/rc.d/S99ftpd.sh stop
/usr/syno/etc.defaults/rc.d/S98findhostd.sh stop
/usr/syno/etc.defaults/rc.d/S97apache-user.sh stop
/usr/syno/etc.defaults/rc.d/S97apache-sys.sh stop
/usr/syno/etc.defaults/rc.d/S95sshd.sh stop
/usr/syno/etc.defaults/rc.d/S86synodms.sh stop
/usr/syno/etc.defaults/rc.d/S85synonetbkpd.sh stop
/usr/syno/etc.defaults/rc.d/S84rsyncd.sh stop
/usr/syno/etc.defaults/rc.d/S80samba.sh stop
/usr/syno/etc.defaults/rc.d/S77synomkthumbd.sh stop
/usr/syno/etc.defaults/rc.d/S66synoindexd.sh stop
/usr/syno/etc.defaults/rc.d/S55lpd.sh stop
/usr/syno/etc.defaults/rc.d/S30hotplug.sh stop
/usr/syno/etc.defaults/rc.d/S25download.sh stop
/usr/syno/etc.defaults/rc.d/S21mysql.sh stop
/usr/syno/etc.defaults/rc.d/S20pgsql.sh stop
/usr/syno/etc.defaults/rc.d/S10UPnPportmap.sh stop
/usr/syno/etc.defaults/rc.d/S09DDNS.sh stop
/usr/syno/etc.defaults/rc.d/S03inetd.sh stop
/usr/syno/etc.defaults/rc.d/S02cardreader.sh stop
/sbin/ifconfig eth0 down



Entries added to /etc/crontab (edit this file directly, copy/paste with putty etc can cause whitespace problems):

#minute hour mday month wday who command
0 14 * * * root /usr/sbin/ntpdate -b ns.tele.dk
30 22 * * sun-thu root /laurence/scripts/sleep_script.sh
0 23 * * fri,sat root /laurence/scripts/sleep_script.sh
30 8 * * mon-fri root /laurence/scripts/reboot_script.sh
0 11 * * sat,sun root /laurence/scripts/reboot_script.sh

Reboot the DS or restart crond. Done.
Laurence Benjamin
Rookie
Rookie
 
Posts: 32
Joined: Tue Nov 14, 2006 3:16 pm


Return to System Managment Mods

Who is online

Users browsing this forum: No registered users and 2 guests