Bacula-users

Re: [Bacula-users] One Copy Job for ALL Clients?

2011-09-11 23:07:05
Subject: Re: [Bacula-users] One Copy Job for ALL Clients?
From: Jim Barber <jim.barber AT ddihealth DOT com>
To: Rodrigo Renie Braga <rodrigorenie AT gmail DOT com>
Date: Mon, 12 Sep 2011 10:47:35 +0800
On 12/09/2011 10:26 AM, Rodrigo Renie Braga wrote:
> Hello everyone.
> 
> In my first attempt using Copy Jobs, I was creating one Copy Job for each of 
> my Clients, with the following SQL Selection Pattern:
> 
>         SELECT max(JobId)
>              FROM Job
>             WHERE Name = 'someClientJobName'
>               AND Type = 'B'
>               AND Level = 'F'
>               AND JobStatus in ('T', 'W')
>               AND JobBytes > 0;
> 
> Basically, every Client had 2 Jobs: one for a normal daily Backup and one for 
> copying it's last Full Backup, using the above SQL Query.
> 
> My question is: do I really need to create a different Copy Job for every 
> Client or can I use only ONE Copy Job that Selects the
> latest Full Backup JobID of all my clients?

I have my full backups go to their own pool.
Then I have just one copy job defined like so:

Job {
  Name = "OffsiteBackup"
  JobDefs = "DefaultJob"
  Type = Copy
  Level = Full
  # Uses the 'Next Pool' definition from FullPool for where to write the copies 
to.
  Pool = FullPool
  # Use SQL to select the most recent (successful) Full backup for each job 
written to the FullPool pool.
  Selection Type = SQLQuery
  Selection Pattern = "SELECT MAX(Job.JobId) FROM Job, Pool WHERE Job.Level = 
'F' and Job.Type = 'B' and Job.JobStatus = 'T' and
Pool.Name = 'FullPool' and Job.PoolId = Pool.PoolId GROUP BY Job.Name ORDER BY 
MAX(Job.JobId);"
  Allow Duplicate Jobs = yes
  Allow Higher Duplicates = no
}

So that SQL formatted over multiple lines for easier reading is:

SELECT
        MAX(Job.JobId)
FROM
        Job, Pool
WHERE
        Job.Level = 'F'
        and Job.Type = 'B'
        and Job.JobStatus = 'T'
        and Pool.Name = 'FullPool'
        and Job.PoolId = Pool.PoolId
GROUP BY
        Job.Name
ORDER BY
        MAX(Job.JobId);

Regards,

----------
Jim Barber
DDI Health

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
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>