Mandi! Bill Arlofski via Bacula-users
In chel di` si favelave...
> First, you are passing them incorrectly. Just quote the whole line like:
Bingo! For google searches, because level have spaces, the correct row is:
Run After Job = "/etc/bacula/scripts/deleteFailedJobs %c \"%l\""
> 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.
But i pay attention to delete EXCLUSIVELY jobs in some well-defined states:
failed_jobids=$(echo -e "gui on\nlist jobs client=$1 jobstatus=f\nquit\n" |
$bcbin -c $bccfg | grep "^| [0-9]" | awk '{print $2}')
failed_jobids+=" "
failed_jobids+=$(echo -e "gui on\nlist jobs client=$1 jobstatus=E\nquit\n" |
$bcbin -c $bccfg | grep "^| [0-9]" | awk '{print $2}')
failed_jobids+=" "
failed_jobids+=$(echo -e "gui on\nlist jobs client=$1 jobstatus=A\nquit\n" |
$bcbin -c $bccfg | grep "^| [0-9]" | awk '{print $2}')
for jobid in $failed_jobids; do
echo -e "delete yes jobid=$jobid\nquit\n" | $bcbin -c $bccfg
done
so instates 'f', 'E' and 'A', not generic jobs/statuses... and 'Run After
Job' get executed if and only if job run correctly.
So i don't see any race condition... i cannot delete the job the script are
run from...
But for a sake of paranoyd, i can use '%i' to test against current job and
do an exception.
I'll give it a try.
--
dott. Marco Gaiarin GNUPG Key ID: 240A3D66
Associazione ``La Nostra Famiglia'' http://www.lanostrafamiglia.it/
Polo FVG - Via della Bontà , 7 - 33078 - San Vito al Tagliamento (PN)
marco.gaiarin(at)lanostrafamiglia.it t +39-0434-842711 f +39-0434-842797
Dona il 5 PER MILLE a LA NOSTRA FAMIGLIA!
http://www.lanostrafamiglia.it/index.php/it/sostienici/5x1000
(cf 00307430132, categoria ONLUS oppure RICERCA SANITARIA)
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users