Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Dec 2000 17:10:09 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Alfred Perlstein <bright@wintelcom.net>
Cc:        Dag-Erling Smorgrav <des@FreeBSD.ORG>, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: src/etc crontab
Message-ID:  <20001210171009.B1675@hades.hell.gr>
In-Reply-To: <20001210052846.E16205@fw.wintelcom.net>; from bright@wintelcom.net on Sun, Dec 10, 2000 at 05:28:46AM -0800
References:  <200012101254.eBACsZu99303@freefall.freebsd.org> <20001210052846.E16205@fw.wintelcom.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 10, 2000 at 05:28:46AM -0800, Alfred Perlstein wrote:
> * Dag-Erling Smorgrav <des@FreeBSD.org> [001210 04:54] wrote:
> > des         2000/12/10 04:54:35 PST
> > 
> >   Modified files:
> >     etc                  crontab 
> >   Log:
> >   On Sundays through Fridays, run daily at 03:01 am.
> >   On Saturdays, run daily and weekly sequentially, starting at 03:01 am.
> >   
> >   This prevents daily and weekly from overlapping, while running weekly as
> >   early as possible  (i.e. as soon as daily finishes) to give it time to
> >   finish before monthly starts at 05:30 am.
> >   
> >   It's probably possible to do something similar with monthly, making it
> >   run as soon as daily (and possibly weekly, if the first of the month
> >   is a Saturday) finishes, but this is left as an exercise for the reader.
> 
> why not have weekly run daily and monthly run weekly which then
> runs daily?

Because there *will* be months that running monthly on their first day
is necessary, but that same day is not the 6-th day of a week, and
weekly doesn't need to run.  To make sure that weekly will run after
monthly finishes, but only when the day of the month is 1, and day of
week is 6, one would need something like:

1      3       2-31    *       1-5,7   root    periodic daily
1      3       2-31    *       6       root    periodic daily weekly
1      3       1       *       1-5,7   root    periodic daily monthly
1      3       1       *       6       root    periodic daily weekly monthly

This will make sure that the succession of scripts will start at 03:01
and run (in this order), daily -> weekly -> monthly.  The rules that I
followed are:

  * Every day run daily first.  Then maybe weekly, and maybe monthly.  
  * On first day of month, make sure that monthly starts after daily.
  * If first day of month is also sixth day of week, interpolate weekly
    between daily and monthly.
  * On other days of the month run only daily.
  * Except when day of week is the sixth, when weekly is run after
    daily too.

What still puzzles me is if that 2-31 will work correctly.  But if you
review this and you like it, I'd happy to see it commited.

- giorgos


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001210171009.B1675>