Bacula-users

Re: [Bacula-users] SQL query for copy jobs

2015-09-02 06:32:15
Subject: Re: [Bacula-users] SQL query for copy jobs
From: Josip Deanovic <djosip+news AT linuxpages DOT net>
To: bacula-users AT lists.sourceforge DOT net
Date: Wed, 02 Sep 2015 12:27:44 +0200
On Tuesday 2015-09-01 20:37:52 Greg Woods wrote:
> I have a job called ARCHIVE-ALL that looks like this:
> 
> JobDefs {
>   Name = "ArchiveJob"
>   Type = Copy
>   Level = Full
>   Selection Type = SQLQuery
>   Messages = Standard
>   File Set = Copy
>   Pool = File
> }
> 
> # Copy (to archive) all not-already-copied successful backup jobs
> Job {
>    JobDefs = ArchiveJob
>    Name = "ARCHIVE-ALL"
>    Client = bstore
>    Selection Pattern = "select JobId from Job j where PoolId=2 and
> Type='B'and Jobstatus='T' and (select count(*) from Job where PriorJobId
> = j.JobId)  = 0"
> }
> 
> PoolId=2 corresponds to my "File" pool, which is where all the backups
> are written to initially. I also have an Archive pool where the copy
> jobs get written.
> 
> This worked well for over a year, but recently, the SQL query is
> matching a whole bunch of jobs that have already been copied, and it is
> failing to match some (like a Full backup I did on a client just today)
> that need to be copied.
> 
> I am theorizing that the reason it stopped working correctly is that a
> lot of the jobs have now been expired, and a recent round of full
> backups required that some jobs from the File pool had to be purged.
> Does this reset the PriorJobId to zero for any jobs that had a
> PriorJobId pointing to a job that is being purged?
> 
> Does anybody have an SQL query that will do what I want (which is to
> copy all the backup jobs from the File pool to the Archive pool that
> have not yet been copied?

Hi.

Check my posts in the thread with the subject "Copy tape job for offsite - 
best practices".

I have just updated the query I am using and it might help you to do what
you want or at least you'll get the idea how to achieve what you need.


-- 
Josip Deanovic

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

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