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.


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

Try reloading the cron jobs:

sudo service reload

available options are:

sudo service {start|stop|status|try-restart|restart|force-reload|reload|probe}
  • 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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