Gregory Brauer wrote:
> Phil Stracchino wrote:
> 
>> The documentation appears to be in error in this regard.  According to
>> Kern, the following Schedule syntax will work for this:
>>
>> Schedule {
>>     Name = "Alternate Pools"
>>     Run = Level=Differential Pool=Pool1 1st,3rd,5th mon-fri at 10:00
>>     Run = Level=Differential Pool=Pool2 2nd,4th mon-fri at 10:00
>> }
> 
> 
> Unfortunately this still doesn't define a 2-week rotation.
> If every month had 4 weeks, then this would work, but
> since some months have 5 weeks you would be repeating the
> same tape set on the 5th week of month 1 and the 1st week
> of month 2.
> 
> Additionally, months don't end on week boundries, so I think
> you would end up switching tapes mid-week here in most cases,
> which is not desireable (or even possible in the case of
> holidays) either.  Since years don't have the same number of
> weeks either, nor do they end on week boundries, this syntax
> doesn't lend itself to weekly rotations.

Both of these are true, as I pointed out to Gilberto (the original poser
of the question).  Even using week-of-year instead of week-of-month
still potentially breaks once a year.

> What you really need is a way to specify "modulo # weeks since
> the epoch."  We too would like this functionality in Bacula.

That would be a good way to handle it, yes.

> The way we currently make bacula do a weekly rotation is with a
> very kludgy hack.  For every client machine, we define two backup
> jobs.  Each job is set up to run on specified days of every
> single week but to backup to a separate pool designated for its
> respective week.  Both jobs for a machine run a RunBeforeJob
> script that will exit non-zero if it is the wrong week for that
> job to be running.

Yes, I've done similar things myself to work around cron limitations
(for instance, for a task which is required to run without fail on the
last, and ONLY the last, day of every month.)

> Specific example:
> 
> First job has:
> RunBeforeJob  = "/etc/bacula/weekcheck 1"
> 
> Second job has:
> RunBeforeJob  = "/etc/bacula/weekcheck 2"
> 
> "weekcheck" just evaluates:
> passed_argument == weeks_since_the_epoch % 2
> and exits 0 if true, and non-zero if false.
> 
> 
> To keep this from spewing error messages by email, we wrote a
> wrapper script for bsmtp called "hideweekerror" that will not
> send out the error message if the exit code is 10, which is what
> bacula gives for a RunBeforeJob error.
> 
> Very, *very* kludgy, but it works.

Not all that horribly kludgy, and a clever and -- by the sound of it --
very well-thought-out solution.


-- 
 Phil Stracchino       [EMAIL PROTECTED]
    Renaissance Man, Unix generalist, Perl hacker
 Mobile: 603-216-7037         Landline: 603-886-3518


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to