Answer the question
In order to leave comments, you need to log in
In what order are tasks scheduled at the same time executed in Cron?
Hello.
There is a weak VPS on Ubuntu server (1 core, 1GB RAM) It is
required to execute a .py file every minute (a Cron task is configured for this). New requirements have appeared: now you need to execute 5 of the same files every minute, only with slightly changed values.
Actually the question is:
If you create five of the same tasks in Cron for each file separately, will they all be executed simultaneously (which can overload the machine) or in some order (in turn)?
Can they be separated? For example, so that they are executed with an interval of 10 seconds?
If Cron is not suitable for this, please advise an alternative way, thanks.
Answer the question
In order to leave comments, you need to log in
Can they be separated? For example, so that they are executed with an interval of 10 seconds?
#!/bin/bash
python script.py
sleep 10
python script.py
....
Do not pull the cron, but start a demon that will start the necessary scripts itself at the required interval, at least every second.
At the same time
Before each task, write sleep and the desired delay
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question