On 5/31/24 8:56 AM, Marco Gaiarin wrote:

If you *really* want to automatically delete failed jobs (I personally don't 
think this is a good idea), you can use a
RunScript in an Admin type Job like:

Why in and 'Admin' job? I've tried to add something like:

        Run After Job = /etc/bacula/scripts/deleteFailedJobs "%c" "%l"

to the backup job; script effectively get run, but seems no parameters get
passed to them.

First, you are passing them incorrectly.  Just quote the whole line like:
----8<----
Run After Job = "/etc/bacula/scripts/deleteFailedJobs %c %l"
----8<----

Second, this will most likely *not* work - and it is why I offered an Admin job 
as a solution.

If you do this, I am not sure exactly what will happen because (behind the scenes) the job is really still running when the RunAfterJob is triggered. So you would be trying to delete a job from the catalog while it is still running, and most likely, the Director would re-insert/update the job after your script deleted it, and uffff, I can only imagine what trouble this might cause.

Stick with the Admin job and the script is my advice here.


The script (little modification of yours) simply filter by client name (eg,
delete jobs of that client, not overral failed jobs) and run only for
VirtualFull level jobs.

Rationale: if a correct VirtualFull job happen, i can safely delete also the 
failed jobs

VirtualFull jobs will never pull in a failed job. They only collect and 
consolidate Backup jobs
that have terminated "Backup OK" (jobstatus='T' in the catalog), so you can 
deleted them any time you like.


time this Admin job is run will be in the Admin Job's joblog. Alternately, you 
can trigger the script from cron, and the
bconsole output will be in the email that cron sends.

The script run by hand works as expected, but clearly i prefere to run from 
bacula.

Yes, as I recommended, but I always try to offer optional solutions w
hen I can. :)


Best regards,
Bill

--
Bill Arlofski
w...@protonmail.com

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to