Thursday, May 26, 2022

[SOLVED] Crontab every monday syntax

Issue

I created a cron date but couldn't be sure. I want to run every monday at 16:25. I got help from https://crontab.guru. According to crontab.guru every monday at 16:25 is

25 16 * * MON

Yo can check here https://crontab.guru/#25_16_*_*_MON . I checked the this time on https://www.freeformatter.com/cron-expression-generator-quartz.html but not working. According to freeformatter must be 0 25 16 ? * MON * and next execution dates is correct. Which one is correct. Which one should i use?


Solution

I believe different cron implementations have different syntax.

For example, crontab.guru refers to cronitor as mentioned on the website:

crontab guru: The quick and simple editor for cron schedule expressions by Cronitor

Similarly, freeformatter refers to Quartz as mentioned on their website:

Generate a quartz cron expression with an easy to use online interface.

Which one should I use?

So I believe that depends on what cron you're using. For me, using crontab.guru worked fine for scheduling jobs on MacOS.



Answered By - cSharp
Answer Checked By - Pedro (WPSolving Volunteer)