Creating a Cron Job - Linux / Python
django, linux, python, ubuntu
Solution
If you have an executable, say `/home/bin/foobar`, that restarts the script, and want to run it (say) every 10 minutes, the crontab entry needs to be:
*/10 * * * * /home/bin/foobar
which says to run it at every minute divisible by 10, every hour, every day.
If you save this (and any other periodic jobs you want to run) as, say, `/home/bin/mycrontab`, then just do `crontab /home/bin/crontab` and the system will do the rest (the script runs with your userid).
To see what periodic jobs you have already scheduled under the current userid, if any, do `crontab -l`.
Problem
Hi I have a Django script that I need to run, I think the commands could be called through bash. Thing is the script causes memory leaks after a long a period of time, so I would like to create an external cron job which calls the Python script. So the script would terminate and restart while retaking the lost memory. Can someone point me in the right direction? I know quite little on the subject, and feel a bit lost.