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've got a couple of scripts that I've had scheduled to run in cron for a while. About a week or so ago, they stopped running as far as the (very basic) logging showed, and also I noticed that my wallpaper wasn't being rotated any more.

josh@sirius:~$ crontab -l
# m h  dom mon dow   command
0 * * * * /bin/bash /home/josh/bin/rotate-wallpaper
*/30 * * * * /bin/bash /home/josh/bin/download-programmes
* * * * * echo "I ran" > /home/josh/cronstamp

Neither of the first two commands are run, but the ~/cronstamp file does get created and written to as expected.

share|improve this question

Looks like your scripts are failing. I would suggest adding 2>&1 > /home/josh/cronlog at the end of your commands, this way you will be able to later inspect what went wrong


# m h  dom mon dow   command
0 * * * * /bin/bash /home/josh/bin/rotate-wallpaper 2>&1 > /home/josh/cronlog
*/30 * * * * /bin/bash /home/josh/bin/download-programmes 2>&1 > /home/josh/cronlog
share|improve this answer

Try reloading the cron jobs:

sudo service reload

available options are:

sudo service {start|stop|status|try-restart|restart|force-reload|reload|probe}
share|improve this answer
This doesn't seem to have made a difference. – dutchie Jan 30 '12 at 10:26

Do your scripts depend on GUI elements (I guess so, since you talk about wallpapers)? Then I guess this won't work, as it misses out on some environment variables in Cron, opposed to running in a terminal window.

If you just need the $DISPLAY and you are not running multiple X-windows, set it like this in your script (on top):


Maybe more are missing. Try debugging further and log all stdout and stderr output from all commands in your scripts as @zakkak explains.

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.