Search code examples
cronexecuteschedule

Cron schedule - Execute job at three different times with no pattern between. Is it possible?


I have a job I want to run using Quartz, which require the time to be specified using a Cron schedule.

The job should run at 17:00, 17:35 and 22:05.

Is it possible to specify these times using a Cron schedule ? I've already looked into the Wikipedia article, but it did not help much. From my point of view, there needs to be a pattern between the times, so that you can specify them using a Cron schedule.

Best regards

Nicolas


Solution

  • You can do it with 3 cron jobs. example :

    > crontab -e
    
    00 17 * * * sh  /example/script.sh
    35 17 * * * sh  /example/script.sh
    05 22 * * * sh  /example/script.sh