shutdown crontab

74 views
Skip to first unread message

Rok Škufca

unread,
Jan 26, 2012, 12:11:59 PM1/26/12
to Webconverger Users
Hi,

now i have a problem with automatic shutdown, i get the command to the
crontab, but it not work.

crontab -e
00 18 * * * root /sbin/shutdown -h now

this must shutdown webconverger at 18pm, but not work?

BR, Rok

Kai Hendry

unread,
Jan 27, 2012, 2:28:52 AM1/27/12
to webc-...@googlegroups.com
Please boot into debug mode.

Can you tell me what date says? It should in UTC and hence you need to
convert your time.

Also tell me the output of cat /etc/crontab

Thanks,

Guttorm Flatabø

unread,
Jan 27, 2012, 2:37:58 AM1/27/12
to webc-...@googlegroups.com

There is also a boot option for time zone AFAIK.

--
You received this message because you are subscribed to the Google Groups "Webconverger Users" group.
To post to this group, send email to webc-...@googlegroups.com.
To unsubscribe from this group, send email to webc-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webc-users?hl=en.

Kai Hendry

unread,
Jan 27, 2012, 2:41:15 AM1/27/12
to webc-...@googlegroups.com
Also output from:

grep -i cron /var/log/syslog


Can be useful in debugging syntax errors in the crontab.

Kai Hendry

unread,
Jan 27, 2012, 3:23:21 AM1/27/12
to webc-...@googlegroups.com
2012/1/27 Guttorm Flatabø <po...@guttormflatabo.com>:

> There is also a boot option for time zone AFAIK.

Quite right. :)


I just tried appending timezone=Asia/Tokyo to the boot cmdline and it worked.

ftp://ftp.iana.org/tz/data/zone.tab is the authoritative TZ list


Oh btw, instead of `shutdown -h now` you an use `halt`

00 23 * * * root halt


Next this info should be on the wiki somewhere.

Rok Škufca

unread,
Jan 27, 2012, 3:23:53 AM1/27/12
to Webconverger Users
date
Fri Jan 27 08:13:43 UTC 2012

cat /etc/crontab
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --
report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --
report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --
report /etc/cron.monthly )
#
00 18 * * * root /sbin/sgutdown -h now


grep -i cron /var/log/syslog
Jan 27 09:13:13 localhost /usr/sbin/cron[1319]: (CRON) INFO (pidfile
fd= 3)
Jan 27 09:13:13 localhost /usr/sbin/cron[1320]: (CRON) STARTUP (fork
ok)
Jan 27 09:13:13 localhost /usr/sbin/cron[1320]: (CRON) INFO (Running
@reboot jobs)
Jan 27 08:16:01 localhost /usr/sbin/cron[1320]: (*system*) RELOAD (/
etc/crontab)
Jan 27 08:17:01 localhost /USR/SBIN/CRON[1600]: (root) CMD ( cd / &&
run-parts --report /etc/cron.hourly)


tnx

Steve Robson

unread,
Jan 27, 2012, 12:59:25 PM1/27/12
to webc-...@googlegroups.com, Rok Škufca
Rok �kufca wrote:

> 00 18 * * * root /sbin/sgutdown -h now

There's your error. It should read "shutdown".

--
Regards,
Steve

Rok Škufca

unread,
Jan 28, 2012, 5:23:39 AM1/28/12
to Webconverger Users
That works for me:

00 22 * * * root halt

i have set the timezone=Europe/Ljubljana, and the time is ok.

In the crontab is set to shutdown at 22:00, but system shutdown 1 hour
later at 23:00?

Regards,
Rok

On Jan 27, 6:59 pm, Steve Robson <srob...@cadence.com> wrote:
Reply all
Reply to author
Forward
0 new messages