Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, I would like to schedule a cron job to run on every first saturday of the month, so far all documentation that I have looked at, mentions only a ...
  1. #1
    Just Joined!
    Join Date
    Feb 2010
    Posts
    1

    How to schedule a cron job

    Hello,

    I would like to schedule a cron job to run on every first saturday of the month, so far all documentation that I have looked at, mentions only a weekly cron or a monthly cron based on the date.

    Is it possible to run a monthly cron based on the day of the week??

  2. #2
    Trusted Penguin Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,392
    Take a look at this man page
    Code:
    man 5 crontab
    in this man page tells us:

    Code:
           cron(8) examines cron entries once every minute.
    
           The time and date fields are:
    
                  field          allowed values
                  -----          --------------
                  minute         0-59
                  hour           0-23
                  day of month   1-31
                  month          1-12 (or names, see below)
                  day of week    0-7 (0 or 7 is Sun, or use names)
    
           A field may be an asterisk (*), which always stands for "first-last".
    
           Ranges of numbers are allowed.  Ranges are two numbers separated with a
           hyphen.   The  specified  range is inclusive.  For example, 8-11 for an
           "hours" entry specifies execution at hours 8, 9, 10 and 11.
    You can see that the day of the week is selected through the 'day of week' field. HTH.
    Linux user #126863 - see http://linuxcounter.net/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...