Currently, I've scheduled a python script on Linux by adding the following: */10 * * * * /file/testscripts/test_script.py
to crontab -e
.
It did not run after 10 minutes, so I wrote some code to write the current time on there but wasn't being updated either.
What could be the issue? And how can I determine my python script has been scheduled for a cron job properly?
Thank you in advance and will accept/upvote answer
There are plenty things you could do:
... test_script.py > /tmp/pythonCron.log 2>&1
As FamousJameous pointed out, when the cron job was started, you should see some lines in /var/log/syslog:
May 15 06:29:00 xyz CRON[9368]: (www-user) CMD (python ...
Try with 10 * * * * yourscript name.Then check if crontab -l is include your script. Then you can check crontab logs.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.