Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 script got executed at 17:20 (see syslog excerpt below).

Being Thu, Nov. 22, I would have expected the script to be executed at 21:20, per the 4th crontab line below.

Why did 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/
40 10 22-30 Nov Sun     myuser /usr/local/projectors/

20 18 22-30 Nov Mon-Wed myuser /usr/local/projectors/
20 21 22-30 Nov Thu-Fri myuser /usr/local/projectors/
20 17 22-30 Nov Sat-Sun myuser /usr/local/projectors/

40  9  1-22 Dec Mon-Sat myuser /usr/local/projectors/
40 10  1-22 Dec Sun     myuser /usr/local/projectors/

20 21  1-22 Dec Mon-Fri myuser /usr/local/projectors/
20 17  1-22 Dec Sat-Sun myuser /usr/local/projectors/

syslog excerpt:

$ grep /var/log/syslog
Nov 22 17:20:01 lanner-ubu-c2d CRON[23007]: (myuser) CMD (/usr/local/projectors/
share|improve this question
You aren't opening the mall ungodly early on Black Friday? :) – Michael Hampton Nov 23 '12 at 0:48
eheh. A good point, but living in Canada, we're not really touched by all this madness! – Guillaume Boudreau Nov 23 '12 at 2:03

My best guess would be that it can't handle Sat-Sun because of this in the man page of crontab(5):

Names can also be used for the ``month'' and ``day of week'' fields.   Use
the  first three letters of the particular day or month (case doesn't mat‐
ter).  Ranges or lists of names are not allowed.

This means some of your lines are simply incorrect and will probably cause unexpected or at least undocumented behaviour.

Therefore, I suggest to change you day of week limits to numbers.

share|improve this answer
Superb. Thanks. I think I saw that paragraph many times, but never bothered to read the end! – Guillaume Boudreau Nov 23 '12 at 2:02
up vote 0 down vote accepted

From crontab(5) man page:

Note: The day of a command's execution can be specified by two fields day of month, and day of week. If both fields are restricted (i.e., aren't *), the command will be run when either field matches the current time. For example, 30 4 1,15 * 5 would cause a command to be run at 4:30 am on the 1st and 15th of each month, plus every Friday.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.