![]() They are set to run every 5 minutes, but the script itself has logic to make sure the first thing it does before anything is to check if that lock is present. Since this second job skips 0 during the 0 hour of midnight this combo should work for you.īut that said, this kind of dual entry logic is why it’s actually encouraged that developers expand their app logic to avoid certain scenarios it won’t work.įor example, I have some bash scripts that create lock files in the standard Unix /tmp directory. What are the benefits of using cron Cron already built, and works, very reliable You more easily have control over when it runs. The next cron entry would run the job every 2 minutes from 2-58 minutes only at midnight. The first cron entry would run the job every 2 minutes from 1:00am to 11:00pm. If that is the case, you might have to set a mix of cron jobs like this: */2 1-23 * * * In short, I need this cron to run every 2 minutes except 12AM. 2-58/2 * * * *ĮDIT: According to the comment left by the original poster: One concept would be to combine an interval ( 2-58) with a frequency ( */2), but unclear if this could work. Perhaps you could do something like create some kind of indicator in the first job that the second job would pick up on so they don’t conflict. The problem is not the cron job but rather your script logic. ![]() ![]() This because this cron depends on another cron which runs once dailyĪt 12AM. How to skip the "0" minute of the "0" hour (12AM) in the cron? I do ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |