Sign up ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

I have a python script running by cron. For what ever reason, it is not running. I am wondering if there is anywhere that error messages are sent? Script runs fine by itself. If I run a simple script with crontab, that just writes to a file that works also.

My crontab is:

*/15 * * * * python ./home/pi/foo/bar.pyw
share|improve this question
Ok, I figured out the issue with my script. I was calling modules which were in the same directory as the bar.pyw script. I changed the working directory with os.chdir("some location"). I still however would like to know where the error messages go for crontabs –  Richard Nov 26 '12 at 19:46

1 Answer 1

By default, the logging for the cron demon is not enabled in Debian (I assume it is the system you are using). To enable it, please open the file /etc/rsyslog.conf via

$ vi /etc/rsyslog.conf

and uncomment the line

# cron.*                          /var/log/cron.log

After that, you need to restart rsyslog via

$ /etc/init.d/rsyslog restart

and you will find the cron logs in /var/log/cron.log

Source: Enable crontab logging in Debian Linux

share|improve this answer
Nice. Thanks. I wonder why it's off my default. –  Elan Hasson Nov 9 '14 at 12:11
Alf: Thank you for your reply. I have now implemented cron logging and have alter the command in my crontab to [Code] */3 * * * * /usr/bin/sudo -H /home/pi/ahbc [/code] The sudo -H is something I found on the web which I am told works. I don't understand just what the -H is there for. I have been given to understand that if one does not include the uservin a crontab command line that command will run using the user/owner of crontab. Therefore as my crontab is user pi crontab the contained commands will run for pi. –  Bex Jan 12 at 7:42
the link is broken now :( –  Michael Jun 8 at 20:27
@Michael The explanation here should be enough to achieve logging. Do you need something else? –  Morgan Courbet Jun 8 at 21:43

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.