Running python scripts consecutively in Crontab

人走茶凉 提交于 2019-12-06 05:26:25
* * * * * python /path/to/script1.py ; python /path/to/script2.py ; python /path/to/script3.py

Use && if you want to run the second script only if the first script is successful (exit code is 0)

Use ; if you want to always run the second script irrespective of first script's exit code

Always provide full path to your script in crontab

Your cron entry is fine.

You may want to create a wrapper script that calls all your scripts in sequence.

Your cron entry should work. However, you may notice that it may fail because you didn't specify the absolute paths for the scripts.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!