Scheduling a python 3.6 script in using crontab/cron

后端 未结 2 723
逝去的感伤
逝去的感伤 2021-01-22 05:22

I\'m just setting up a cron tab/job on my Cent OS developement server.

Within my crontab I have the following. (Ignore the time setting, this was added about 15:32 UTC s

2条回答
  •  不要未来只要你来
    2021-01-22 06:02

    Try using absolute paths in your crontab command:

    34 15 * * * cd /foo/bar/welcomeclient-0.0.5 && /usr/bin/python3.6 main.py
    

    or, assuming the main.py does not also make use of relative paths inside of it :

    34 15 * * */usr/bin/python3.6 /foo/bar/welcomeclient-0.0.5/main.py
    

提交回复
热议问题