Doubts in the functioning of a CRON task, No and how to SCHEDULE and yes the FUNCTIONING of it

Asked

Viewed 49 times

-1

I have a question about scheduling tasks in CRON and I would like more clarification on how it works.

If I have a task to perform every minute, and this task for example takes longer than 1 minute, EX: I have a report with more than 20,000 lines and the execution of a routine go through 15,000 lines and perform a comparison task takes two minutes.

Then the CRON Schedule is scheduled to run again in the next 60 seconds.

The task previously scheduled for or finished? Even if the second one was called.

Remembering that this is an example above to know how it works, and doubt not how to Schedule and yes how the queue works

  • I believe, I am not sure, that cron will only start that process at certain periods, that is, the tasks will accumulate, if it takes 2min in half of the time another task will start. This is not very recommended since there may be conflicts and, after some time, overload the server

  • After reading it here: https://pt.wikipedia.org/wiki/Crontab, you have no further questions.

  • I get it, I’m gonna see what I can do here You’ll always have to finalize a process to start the secret

1 answer

0

cron respects the schedule you made, if it is 1 in 1 minute, it will start the 1 in 1 minute script regardless of the previous run being finished.

You can, in your script or program, implement a queue or something of the kind that makes the next process wait for the end of the execution.

  • I also think that Juliano, hopefully for sure, I will test here and see what will work, and the good and that is not in danger of lining up the queue because it will erase the finished processes!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.