For testing purposes, I have a very simple python script which creates a text file, named with current datetime so I can tell when it has been ran:
#!/usr/bin/python
from time import gmtime, strftime
try:
filename = strftime("%Y-%m-%d %H:%M:%S", gmtime())
f = open(filename+'.txt', 'w')
f.write('HelloWorld')
f.close()
except StopIteration:
print "An error has occurred.."
I have placed the file here and it has full permissions:
usr/share/pyshared/scripts/test_script.py
When i run the script manually with the following, the script runs and creates my test text file:
python ~/../../usr/share/pyshared/scripts/test_script.py
In my crontab file I have the following which does not run (should run every minute for testing purposes).
* * * * * python ~/../../usr/share/pyshared/scripts/test_script.py
First time experimenting with crontab and fairly new to linux as well so forgive me if I've missed something fairly obvious here, Thanks in advance.