E
E
Ernest Faizullin2016-08-26 10:05:17
linux
Ernest Faizullin, 2016-08-26 10:05:17

How to prevent that during the execution of one cron, another does not start executing?

A lot of cron tasks have gathered on the server, the execution time may be different for everyone. It is necessary to prevent that during the execution of one cron, another does not start executing. Tell me, how do people do this kind of optimization?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2016-08-26
@erniesto77

1. collect everything that should not overlap into one script and add only it to cron
2. create a lock file for other jobs. check for the existence of the file and exit if there is, or in a loop wait for the lock to be released.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question