I'm new to linux, and was told I could use a feature called cron job to run a python script I made execute every 10 minutes. Problem is the the python script isn't running. There doesn't seem to be a clear cut way to know if I've formatted the job correctly, but in any case I've tried a number of paths to no avail.
Because I'm so new I'll show you the steps I took. On my RasPi, I first typed "crontab -e" and get a field like this:
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
Skipping more help text
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
# m h dom mon dow command
and I add my line at the bottom, without removing the text above.
*/10 * * * * ~/WeatherProject/HOURLY/windDirExtract.py
The above didn't work, and someone else did something similar to this but still no luck.
*/10 * * * * /home/MyName/WeatherProject/HOURLY/windDirExtract.py
and then I tried different permutations but I've got nothing.
*/10 * * * * /home/MyName/WeatherProject/HOURLY python windDirExtract.py
*/10 * * * * /home/MyName/WeatherProject/HOURLY windDirExtract.py
I'll make any edits if I haven't been clear, but first big question is can I even run short little python scripts with Cron Job, or did I just get bad advice?
chmod +x
), and does it begin with#!/usr/bin/python
?sudo grep CRON /var/log/messages
or Debian/Ubuntu:sudo grep CRON /var/log/syslog
cron
needs to be running which it isn't on my system.ps -eaf|grep cron
do you get any processes running?