Python Forum

Full Version: How to order the Cronjobs to avoid overlap or conflict
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am running two cronjobs for python script every 5 minutes on ubuntu system, both are running successfully but not in the same order. when I checked log I found that some times second job ran first and some times befor completing first job second job triggered.Is there any way I can schedule in such a way that 2nd job should start after completing first job and both should run every 5 mins.
 

 
*/5 * * * * cd path/to/script && /usr/bin/python3 comand.py -pgw y */5 * * * * cd path/to/script && /usr/bin/python3 comand.py -px y
*/5 * * * * cd path/to/script && /usr/bin/python3 comand.py -pgw y && /usr/bin/python3 comand.py -px y