I have python script which runs fine. I want to run it as a cron job every 10 minutes
crontab -e and entered the line
*/10 * * * * root python /path/to/script/script.py
It doesn't seem to be running.
So I've played around on the command line and seeing at which point it stops running. It runs in it's directory and every one preceeding it until I move out of my home directory (ie if I'm in
/home/henry/ then it runs but if I'm in, for example,
/var then it doesn't) when I get a permission error trying to write to a file.
# save this for next time with open(mycsvfile, "w") as outfile: writer = csv.writer(outfile) writer.writerows([s.strip().encode("utf-8") for s in row ]for row in list_of_rows) outfile.close()
I've already done
chmod +x /home/user/Location/Of/Script to ensure the script has access (I thought). What am I missing? Thanks for your help