Bacula-users

Re: [Bacula-users] Copy tape job for offsite - best practices

2015-07-30 19:02:18
Subject: Re: [Bacula-users] Copy tape job for offsite - best practices
From: Josip Deanovic <djosip+news AT linuxpages DOT net>
To: bacula-users AT lists.sourceforge DOT net
Date: Fri, 31 Jul 2015 01:01:02 +0200
On Thursday 2015-07-30 16:11:55 Bill Arlofski wrote:
> On 07/29/2015 05:16 PM, RAT wrote:
> > I'm not (easily) finding a way to copy weekend full backups to a 2nd
> > tape for offsite.  I've seen some pretty elaborate SQL programs. 
> > Isn't there an easier way?
> 
> Hi Robert,
> 
> I can't officially call this a "best practices" response, but one thing
> you might want to try to avoid dealing with complex SQL queries for
> copy jobs is this:
> 
> - Set up a pool where your weekend jobs are written to.
> 
> - In that weekend pool make sure to set the "NextPool =" directive to
> point to a pool that your offsite tape drive can use.
> 
> - Set up a copy job with the "Pool =" directive pointing to that weekend
> pool ("Pool = " directive in a copy job refers to the originating
> pool).
> 
> - Set the copy job's SelectionType = PoolUncopiedJobs
> 
> - Schedule the copy job to run after all weekend jobs are expected to be
> done and/or set its priority lower so that even if it is scheduled for
> the same time as the rest, it will be queued and will not start until
> the backup jobs are finished.
> 
> 
> Now there are no "unsightly SQL queries" in your copy job's
> configuration, and your weekend jobs are easily identified by the copy
> job based on the fact that they are in one pool.
> 
> Once a job has been copied, it will not be copied again if you use the
> "PoolUncopiedJobs" SelectionType, so this is a nice shortcut.
> 
> Now you might need this to be a little more complex if you have (or
> require) multiple weekend pools. For example, you may have Full, Inc,
> and Diff weekend pools, or weekend pools based on client, or type of
> job (web servers, windows servers, db servers etc)  In which case you
> just need to build on the basic example and create those multiple
> weekend pools, and multiple Copy jobs to address each pool.


I have played with the  "SelectionType = PoolUncopiedJobs" option some
time ago and have found it problematic because the first time you use it
it will copy every job existing in the database which is not yet copied.

Since I wanted to start with copying only the latest full and related
differential and incremental jobs I have opted for writing an SQL query.
I have found an SQL query somewhere in the bacula source and I have used
it as a starting point for an improved SQL query which matches my
requirements.

I have came up with the SQL query which matches only the latest successful
full and all the related successful differential and incremental jobs
which haven't already being copied. I am using it to copy jobs to a remote
location.

If someone needs it I can post the SQL query here.

-- 
Josip Deanovic

------------------------------------------------------------------------------
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users