View Full Version : [all variants] Cron task confusion

March 8th, 2009, 04:04 AM

Have a Python script I want to run as a cron task but failing miserably.
To test it I'm running every minute; eventually would run every 30 minutes. The output of crontab -l is

blairm@orpheus:~/Documents$ crontab -l
* * * * * /home/blairm/Documents/rsscollect2.py

It runs fine from the terminal with the command python rsscollect2.py

Looking in the system log, I'm getting the following:

2009-03-08 15:52:01 orpheus /USR/SBIN/CRON[25267] (blairm) CMD (/home/blairm/Documents/rsscollect2.py)
2009-03-08 15:52:01 orpheus sSMTP[25269] Unable to locate mail
2009-03-08 15:52:01 orpheus sSMTP[25269] Cannot open mail:25
2009-03-08 15:52:01 orpheus /USR/SBIN/CRON[25261] (blairm) MAIL (mailed 66 bytes of output but got status 0x0001 )
2009-03-08 15:53:01 orpheus /USR/SBIN/CRON[25450] (blairm) CMD (/home/blairm/Documents/rsscollect2.py)
2009-03-08 15:53:01 orpheus sSMTP[25452] Unable to locate mail
2009-03-08 15:53:01 orpheus sSMTP[25452] Cannot open mail:25
2009-03-08 15:53:01 orpheus /USR/SBIN/CRON[25444] (blairm) MAIL (mailed 66 bytes of output but got status 0x0001 )
2009-03-08 15:53:58 orpheus dhclient DHCPREQUEST of on eth0 to port 67
2009-03-08 15:53:58 orpheus dhclient DHCPACK of from
2009-03-08 15:53:58 orpheus dhclient bound to -- renewal in 148 seconds.

Can anyone give me a hint as to what I'm doing wrong?



March 8th, 2009, 03:44 PM
Is there something in the file that lets the system know to run it with the python interpreter?

Perhaps you can change your crontab to:

* * * * * python /home/blairm/Documents/rsscollect2.py

March 8th, 2009, 08:02 PM
Thanks for that, works perfectly.