Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does below cron expression ,means?

i have below cron expression.

"0 0 0 ? * SUN"

when exactly this is executed? midnight of sunday of saturday?

Thanks!

like image 319
user1199334 Avatar asked Feb 10 '12 14:02

user1199334


1 Answers

See the tutorial

*   *    *    *    *    *   (year optional)
┬   ┬    ┬    ┬    ┬    ┬
│   │    │    │    │    │
│   │    │    │    │    │
│   │    │    │    │    └───── day of week (0 - 7) (0 or 7 is Sun, or use names)
│   │    │    │    └────────── month (1 - 12)
│   │    │    └─────────────── day of month (1 - 31)
│   │    └──────────────────── hour (0 - 23)
│   └───────────────────────── min (0 - 59)
└─────────────────────────      seconds

Wild-cards (the * character) can be used to say "every" possible value of this field. Therefore the * character in the "Month" field of the previous example simply means "every month". A '*' in the Day-Of-Week field would therefore obviously mean "every day of the week".

The '?' character is allowed for the day-of-month and day-of-week fields. It is used to specify "no specific value". This is useful when you need to specify something in one of the two fields, but not the other. See the examples below (and CronTrigger JavaDoc) for clarification.

So it means every sunday at midnight

like image 116
stacker Avatar answered Nov 05 '22 08:11

stacker