Amanda-Users

Re: Putting on my Amanda hat

2004-07-21 17:31:22
Subject: Re: Putting on my Amanda hat
From: Jon LaBadie <jon AT jgcomp DOT com>
To: Jon LaBadie <amanda-users AT amanda DOT org>
Date: Wed, 21 Jul 2004 17:27:45 -0400
On Wed, Jul 21, 2004 at 10:55:00AM -0700, Mike Fedyk wrote:
> Jon LaBadie wrote:
> 
> >On Tue, Jul 20, 2004 at 05:13:46PM -0700, Mike Fedyk wrote:
> > 
> >
> >>Hi guys,
> >>
> >...
> >
> >>I want to have another cycle running every other Friday (two weeks), but 
> >>cron doesn't seem to be able to handle that.  I posted to the 
> >>fedora-list and someone posted  this[1] script (yes, yes, I know it's 
> >>not ready for submission yet. It needs modification before it's useful 
> >>for what I want...).  I was thinking someone would have something based 
> >>on the "at" command, but this looks ok too.
> >>
> >...
> > 
> >>[1]
> >>if test -f /etc/foo
> >>then
> >>  rm -f /etc/foo
> >>else
> >>  touch /etc/foo
> >>  exit 0
> >>fi
> >>   
> >
> >
> >Kidding right?
> > 
> Actually no.
> 
> If you're going to do that, why not use "date +%U" instead?  Then you 
> don't depend on jday, or is that only available in GNU date?

Some years have 52 Fridays, some 53.  In the latter case you may
get extra dumps or miss some dumps.

> 
> I chose the temp file approach because it's simpler for the operator to 
> check and see if a file is there to know which command will run.  I 
> suppose you could do the same with odd or even numbers though.  With the 
> temp file it can use one script (call it "alternate"), and the time is 
> determined on how often it is called, so you could alternate monthly 
> just by calling it once a month.

The operator has to know where the name of the flag file,
where the flag file is located (I certainly would not recommend /etc),
whether it means the dump will be or won't be done, 
and puts a lot of faith in the stability of a single file.

> Really, it's just to get around deficiencies in cron's scheduling 
> capabilities.

The concept of running a wrapper from cron to decide if a program
should or shouldn't run is a tried and true approach.  It is only
your test that I questioned.

> 
> Can we keep this on the list?  Thanks.

-- 
Jon H. LaBadie                  jon AT jgcomp DOT com
 JG Computing
 4455 Province Line Road        (609) 252-0159
 Princeton, NJ  08540-4322      (609) 683-7220 (fax)

<Prev in Thread] Current Thread [Next in Thread>