Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 have a script that creates a file in cron.d and puts some jobs in it. Cron seems to not execute these jobs at all, since the program it runs is set to log all executions. The file inside cron.d looks something like this:

*/1 * * * * root /usr/bin/python /home/myname/ --switch1
2 21 * * 4 root /usr/bin/python /home/myname/ --switch2 --switch3

Neither of these jobs is executed and I can't find anything in grep CRON /var/log/syslog. The scripts work fine when executed normally. Any ideas?

EDIT: Adding the line */1 * * * * root echo "something" >> /tmp/something works fine.

Note: Though AskUbuntu won't show it, the file does have a trailing newline.

share|improve this question

Turns out, my script was creating the file in cron.d with the wrong permissions. This was causing cron to ignore the script.

chmod 600 /etc/cron.d/myfile fixed the problem.

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.