Re: Automatically cancel backup jobs --> do not mark as fatal
Bill Arlofski via Bacula-users <[email protected]>
| Newsgroups | gmane.comp.bacula.user |
|---|---|
| Message-ID | <[email protected]> |
On 9/10/24 5:21 AM, Bruno Bartels \(Intero Technologies\) via Bacula-users wrote:
> Hi alltogether,
> I have adjusted Bacula to cancel jobs, that are duplicates of one job (Disable "AllowDuplicateJobs", or
> "DisableDuplicateJobs" AND "CancelQueedDuplicates, which should be the same
> im my understanding).
> The reason for this is, that there are running some really big full backups, that take few days to finish, and meanwhile
> there is the possibility, that the same job can start in a lower level
> (incremental/differential)
> This works fine, except one problem:
> When the new job gets canceled there is this error thrown in the logs:
>
> Fatal error: JobId XXX already running. Duplicate job not allowed.
>
> And Bacula is sending out a mail.
>
> Question: Is there possibility not log this as FATAL ERROR?
>
> I want to receive mails concerning fatal errors, so setting the message ressources isn't a option.
>
> Can you please help?
>
> Thank you in advance
>
> Bruno
Hello Bruno,
You cannot do this the way you are currently trying because as you have seen, Bacula will cancel the job, and it will show up
as a "non good" (canceled) job in the catalog, and you will get the failed job email.
Fortunately, there is a new feature which was added recently that should solve this issue for you.
It is called 'Run Queue Advanced Control' which adds a new "RunsWhen" setting for your job Runscripts. The new setting is
"RunsWhen = queued"
The idea is that instead of using the AllowDuplicateJobs, DisableDuplicateJobs, and CancelQueedDuplicates job options to
control if a job is allowed to be queued/started, you add a RunScript{} stanza to your job, set the RunScript's "Runswhen =
queued", and have the RunScript's "Command =" setting point to a custom script (we have examples).
The script's returncode/errorlevel will determine whether the job enters the queue, or is just dropped and forgotten about -
producing no canceled jo
b, and no job error email.
Using this new advanced "RunsWhen = queued" level, you should be able to accomplish what you are looking to do:
- Prevent same jobs from being queued when the same job is already running
- Prevent duplicate jobs from being canceled and error emails from being sent.
This new feature is available since Bacula Community version 15.0.x, which closely tracks Bacula Enterprise v16.0.x.
It is documented here in the Enterprise manual:
https://docs.baculasystems.com/BETechnicalReference/Director/DirectorResourceTypes/JobResource/index.html#job-resource
The section you are looking for is named: "Notes about the Run Queue Advanced Control with RunsWhen=Queued"
Please make sure you are running Community version v15.0.2 first, then give this a try and let me know if this helps.
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, 509 B)
-----BEGIN PGP SIGNATURE----- Version: ProtonMail wsBzBAEBCAAnBQJm4UnECRBIDTDab9XDQBYhBMuLnlBaSQiuSUbb6UgNMNpv 1cNAAADJ/gf9H9BCuR+/O6thjkqssTpAzSdCyDk+nHE67eOOreDRRmNWshM8 BigN0jV4SRMDqgcL1vZe5lBlGWUE9FopH0pU1UKwi09BPQkcLaw2W7OCD95k V/Y9jJdzcyW0sMYVvw7nitZFQyXXjRIY0ycwfHaNZEOknA+/GkZ048w8qfve 3JhSuOxUO5tduatbR6VBFQAxcVlyVjfPAmMGM0HJxoiJJyKoXG/PVtc6cyj9 UKa5YEpdUp2yf3SMo/2G0C/vjEEIS/SqZP7nw5yGKPcmUXdb6Slth0Vd3RO5 Gvw1JIomTZtN9JJokPUhROJtvo5gIQ2KBct7Bk8YXbFziCXm5kBVCg== =P7k1 -----END PGP SIGNATURE-----