CRON task every minute is this normal?

Hello, is it normal to create a CRON job for every minute?
For example I need every minute to execute a certain php script which checks the database.

And is it OK to do dB queries every minute?
March 19th 20 at 08:34
3 answers
March 19th 20 at 08:36
CRON task every minute is this normal?

Yes
*If the problem lasts much less than a minute - Esmeralda.Glover94 commented on March 19th 20 at 08:39
You can create a pid and do not execute a task if the previous is not completed. - kristin66 commented on March 19th 20 at 08:42
@Esmeralda.Glover94, Short question - short answer - Raquel.Sawayn commented on March 19th 20 at 08:45
March 19th 20 at 08:38
Not normal.
And if you need every half a minute to run, you will sleep insert?
And if the problem lasts longer than a minute?
Apparently, you are the instrument chosen. You may need to do in any event, not to check the database. Think about the queues.

Put event to the queue handler queue it processed without delay.
And where does the sleep?

Time in dB is specified, that we need to check it out. - darren.Moo commented on March 19th 20 at 08:41
sleep - in order to start not at the beginning but the middle. Unfortunately, I've met a couple of projects.

Time in dB is specified, that we need to check it out.
Here's the program that writes to the database, and create a message to the queue. - Elijah.Douglas commented on March 19th 20 at 08:44
@Elijah.Douglas, But if one script is constantly (every minute) to check the database and then if the condition is to run another script, as I believe this approach is normal? - darren.Moo commented on March 19th 20 at 08:47
@darren.Moo, why do you want to constantly check and fail to receive the notification about the event when it occurred? - Elijah.Douglas commented on March 19th 20 at 08:50
@Elijah.Douglas, Well, how do I get event from dB, at the onset of the time there specified? - darren.Moo commented on March 19th 20 at 08:53
@darren.Moo, but as it appears there? You the wrong end of the problem is solved. - Elijah.Douglas commented on March 19th 20 at 08:56
March 19th 20 at 08:40
No.

Write demon.

Find more questions by tags The task schedulersLinux