All of us have been writing some kind of cron but recently we came a situation where cron has to be fired by weekly on Wednesday. Keeping in mind the client requirement we came to a particular solution.
Minute Hour date-Of-Month Month Day-Of-Week /path/of/command-script
Day of week represented in Crontab as follows
Sunday = 0
Monday = 1
Tuesday = 2
Wednesday = 3
Thursday = 4
Firday = 5
Saturday = 6
Thus keeping in mind our requirement cron for alternate Wednesday is :
30 00 1-4,15-18,29-31 * 3 give-path-of-script-command
We can have similar cron for other weekdays based on the above cron.
0 Comment(s)