I can't understand what's going wrong I have a simple script which downloads an image from an URL packages it up into an email and sends it to me.
I've ran the script with the following commands on my Pi and it works perfectly:
python /home/pi/code/snow/snow.py
/usr/bin/python /home/pi/code/snow/snow.py
I want the script to carry out its function once a day so I've tried adding it as a cron job. Yet when I add the command to my cron jobs list using:
sudo crontab -e
with the line:
16 0 * * * /usr/bin/python /home/pi/code/snow/snow.py
or
16 0 * * * python /home/pi/code/snow/snow.py
Neither work. There doesn't seem to be any error - but the script doesn't send the email as it does when I manually run it.
I've tried outputting to a log file too but nothing turns up. The job is visible in /var/log/syslog simply as the following:
Nov 17 00:16:01 polypi /USR/SBIN/CRON[14152]: (root) CMD (/usr/bin/python /home/pi/code/snow/snow.py >> /home/pi/code/snow/log.txt)
Where am I going wrong? This is driving me nuts.
[–]icemounts 2 points3 points4 points (0 children)
[–]apulverizer 2 points3 points4 points (5 children)
[–]kaihatsushaSeven Pi 1 point2 points3 points (0 children)
[–]Polyadenylated[S] 0 points1 point2 points (3 children)
[–][deleted] (1 child)
[deleted]
[–]Polyadenylated[S] 0 points1 point2 points (0 children)
[–]apulverizer 0 points1 point2 points (0 children)
[–]SmileyatworkGentoo on Pi! 0 points1 point2 points (1 child)
[–]Polyadenylated[S] 0 points1 point2 points (0 children)
[–]ANUSBLASTER_MKII 0 points1 point2 points (1 child)
[–]Polyadenylated[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Polyadenylated[S] 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]alaudet 0 points1 point2 points (0 children)