Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to run cron on alternate week on particular week day?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.61k
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: