NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

crontab fun

Quoting the fine crontab(5) manual:

       Note: The day of a command's execution can be specified by  two  fields
       --  day  of month, and day of week.  If both fields are restricted (ie,
       aren't *), the command will be run when either field matches  the  cur-
       rent time.  For example,
       ``30 4 1,15 * 5'' would cause a command to be run at 4:30 am on the 1st
       and 15th of each month, plus every Friday.

How can you run a command when _both_ fields match?

If the rule were _both_ and I wanted _either_, I could write 2 lines
in crontab. The opposite isn't obvious to me. A use case for _both_
would be "run this backup every Friday unless it's the first of the
month (because the different monthly backup is running)" - and I can't
believe I'm the first one to encounter this ;-)




Home | Main Index | Thread Index | Old Index