开发者

Complex time schedule for cron job in AppEngine(Java)

开发者 https://www.devze.com 2022-12-20 01:56 出处:网络
I need a cron job 开发者_运维问答to run on every 15 mins in every weekday just from 8:00 to 16:00.

I need a cron job 开发者_运维问答to run on every 15 mins in every weekday just from 8:00 to 16:00.

How to set the Schedule Format for this cron job?


The simplest approach: set it to run every 15 minutes anyway, and then at the very start of your application code just bail out immediately and innocuously if it's not a weekday or the time is too early or late. This will serve you particularly well if and when further complications are involved (this schedule looks suspiciously like "working hours" so it can't be long before somebody asks you to avoid running on Christmas and the like;-).


Take a look at this link which describes how to create a cron expression http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html

It should be something like this for your case 0 0/15 08-16 * * MON-FRI (Not validated)

0

精彩评论

暂无评论...
验证码 换一张
取 消