21

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
Richard
  • 481
  • 2
  • 5
  • 9

2 Answers2

27

By default, the logging for the cron daemon 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

Kioshiki
  • 103
  • 3
Morgan Courbet
  • 3,703
  • 3
  • 23
  • 38
4

Crontab has several parameters (in additional to time execution lines) For example:

MAILTO="you@example.com"
SHELL="/bin/bash"
goldilocks
  • 60,325
  • 17
  • 117
  • 234
DGerman
  • 41
  • 1