Re: Selecting jobids for restores

Bill Arlofski via Bacula-users <[email protected]>
Newsgroups gmane.comp.bacula.user
Message-ID <[email protected]>
On 7/19/25 12:46 PM, Michel Figgins wrote:
 >> Thanks Bill!

Hello Michel. You are welcome. :)


> I have 2 jobs configured for each client that are identical other than storage/pool.

Do you realize that you can override the Pool and Storage in a schedule, on the command line, or just before submitting a job?

Using the Schedule option, then you can have one Job/Fileset configured for each client, and do something like:
----8<----
Schedule {
   Name = Local_and_Remote
   Run = Storage=Local  Pool=Local   Level=Full             sun at 23:00
   Run = Storage=Local  Pool=Local   Level=Incremental  mon-sat at 23:00
   Run = Storage=Remote Pool=Remote  Level=Full             sun at 20:00
   Run = Storage=Remote Pool=Remote  Level=Incremental  mon-sat at 23:00
}
----8<----

BUT... Rather, than backing up the same thing twice from each client, Copy jobs - as you mentioned in your first post - are 
probably a better direction to pursue.


> What I have wound up doing 
is firing up psql and using these:
> select MAX(jobid) from Job where clientid = (select clientid from Client where name='server1-fd') and poolid=7 and level='F';
> select MAX(jobid) from Job where clientid = (select clientid from Client where name='server1-fd') and poolid=7 and level='D';
> select jobid from Job where clientid = (select clientid from Client where name='server1-fd') and poolid=7 and level='I' and jobid > (select MAX(jobid) from Job where clientid = 14 and poolid=7 and level='D') and jobbytes > 0;
> having already figured out that poolid 7 is my local storage pool.

 > (My apologies to anyone who looks at my SQL and cringes)

No need to be embarrassed if it got you what you needed... :)


> The jobbytes >0 bit is because of some later jobs that failed.

That's what the "jobstatus='T'" in my example query was for. A job status of 'T' means "Backup OK", or "Backup OK -- with 
warnings" :)


Best regards,
Bill

-- 
Bill Arlofski
[email protected]

_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users
signature.asc (application/pgp-signature, 583 B)
-----BEGIN PGP SIGNATURE-----
Version: ProtonMail

wsCpBAEBCABdBYJoe/beCZBIDTDab9XDQDUUAAAAAAAcABBzYWx0QG5vdGF0
aW9ucy5vcGVucGdwanMub3Jn+nUeZVcNEZ28jBqZouhfDxYhBMuLnlBaSQiu
SUbb6UgNMNpv1cNAAAB4dQf+NbxU8JUFd9LzIVL7j6N5KAQlgE6Md+XyOUJZ
bH9MEo5H2TD1jo1tv5wfI6H7QV2/1NpjHREzB6QRrUomeViTO3l5VVlybhrV
5hM0lWBGztKEhsQq7UYzHWHRk5mQ1QaM3PJ6o9cbjQ/9ut/JFi0XZTTfetAG
ZewaD9XsCHgv06YyT4onBRU84JbJoLJJ2sXO5MGw7f/87PKLZTuij3etc2Dy
7bQYP9fAg61UcnkD343DDKeI1G5OohqB47qRrEANflgtG3mOkRBRoUlX6+Nl
EtgyWUGKvsJ/qfG8wlCIMTnuwWCno4pfHkAw3DbZoYF0DJP09f2NmvDFvoH2
s/efDA==
=388S
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.