Creating a Cron Job - Linux / Python

后端 未结 4 2088
南笙
南笙 2021-01-14 04:09

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 perio

4条回答
  •  广开言路
    2021-01-14 04:45

    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.

提交回复
热议问题