What is wrong with those crontabs?
Posted
by
Guillaume Boudreau
on Server Fault
See other posts from Server Fault
or by Guillaume Boudreau
Published on 2012-11-23T00:15:50Z
Indexed on
2012/11/24
23:06 UTC
Read the original article
Hit count: 265
cron
I want my projectors to Power On before the mall opens, and Power Off when the mall closes. So I created crontab entries (that I placed in /etc/cron.d/mall), but today (Thu Nov 22 18:58:29 EST 2012
is the current date
on that server), the power-off.sh script got executed at 17:20 (see syslog excerpt below).
Being Thu, Nov. 22, I would have expected the power-off.sh script to be executed at 21:20, per the 4th crontab line below.
Why did power-off.sh execute at 17:20? What is wrong with my crontab entries?
Content of /etc/cron.d/mall
:
40 9 22-30 Nov Mon-Sat myuser /usr/local/projectors/power-on.sh
40 10 22-30 Nov Sun myuser /usr/local/projectors/power-on.sh
20 18 22-30 Nov Mon-Wed myuser /usr/local/projectors/power-off.sh
20 21 22-30 Nov Thu-Fri myuser /usr/local/projectors/power-off.sh
20 17 22-30 Nov Sat-Sun myuser /usr/local/projectors/power-off.sh
40 9 1-22 Dec Mon-Sat myuser /usr/local/projectors/power-on.sh
40 10 1-22 Dec Sun myuser /usr/local/projectors/power-on.sh
20 21 1-22 Dec Mon-Fri myuser /usr/local/projectors/power-off.sh
20 17 1-22 Dec Sat-Sun myuser /usr/local/projectors/power-off.sh
syslog excerpt:
$ grep power-off.sh /var/log/syslog
Nov 22 17:20:01 lanner-ubu-c2d CRON[23007]: (myuser) CMD (/usr/local/projectors/power-off.sh)
© Server Fault or respective owner