+4 votes
by
I have two questions.
Is it possible to put a cron for 1 minute and check whether there is a task for the script, in the database and if there is to execute it, and this is not fast? Mostly interested in the load on the server.
And what happens if at the same time, through the cron, several times to access the same script, it will not happen that the requests will conflict with each other?
by
several times to the same script, won't the requests conflict with each other?

See systemd unit, it is a more flexible replacement for cron.
by
Check out the answer here https://qna.habr.com/answer?answer_id=1403676 I once described how to make a primitive job queue

1 Answer

0 votes
by
 
Best answer
> Is it possible to put the crown on for 1 minute
You can.

> and check if there is a task for the script in the database
You can.

> and, if there is one, perform it,
Can

> Isn't that fast?
And that's not a question.

> Mainly interested in the server load.
The load from the crown will be negligible. Depends on your script.

> And what happens if you access the same script several times at the same time, through the cron
The script will be executed several times.

> won't it happen that the requests will conflict with each other?
If you handle this situation in your script, they won't. There are no built-in mechanisms for this in the cron.
...