6
6
6Mkfcbpwamxx2021-12-28 23:59:46
linux
6Mkfcbpwamxx, 2021-12-28 23:59:46

Will the cron script run if the previous script is still running?

Let's imagine that there is a php script that runs cron once a minute. If the script was launched and takes a long time, will the same script run through cron at the right time? It turns out, they will be executed in parallel? More precisely, two copies will be executed independently of each other? Or will they be queued and the second one will run after the first one is done?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Drno, 2021-12-29
@6Mkfcbpwamxx

in parallel

A
Alexander Karabanov, 2021-12-29
@karabanov

CRON does not know how to lock, you will either have to hack your own using, for example, flock, or use systemd-timer - there are locks and delays out of the box, and it’s much more convenient to set the execution time.
https://habr.com/ru/post/535930/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question