Re: [Bacula-users] copy job scheduled immediately after backup job
2010-08-23 20:40:06
On 23/08/2010 7:39 PM, James Harper wrote:
> If I schedule a copy job immediately after a backup job (eg like 1
> second after), when does the selection actually get done? I want the
> copy to be of the job that is running now, but I think that the
> selection happens when the job is queued not when it is ready to run so
> it would not see the job that is running now... does that sound right?
>
> Thanks
>
> James
Yes, I also found that the selection criteria happens at scheduled time rather
execution time.
I used an Admin job to get around it.
In my case I have the following two jobs to handle my copy job:
Job {
Name = "ScheduleOffsite"
JobDefs = "DefaultJob"
Type = Admin
Schedule = "OffsiteBackupSchedule"
RunAfterJob = "/bin/sh -c \"/bin/echo 'run job=OffsiteBackup yes' \|
/usr/bin/bconsole\""
}
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 Job.JobId;"
Allow Duplicate Jobs = yes
Allow Higher Duplicates = no
}
The Admin job is the one I put in the schedule behind a Virtual Full backup job
that I run at the end of each week.
That way the "OffsiteBackup" job doesn't get a chance to run until it is ready
to execute.
Then the SQL selection will execute at the correct time, once the most recent
Virtual Full backups are complete.
Regards,
----------
Jim Barber
DDI Health
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users
|
|
|