There is a Run After parameter in Bacula configs. But what if I need to wait for several jobs to finish and then run my script?


Make all the jobs but one have the same priority, the same start time, and set concurrency to 1, and disallow mixed priorities. Then for the last job, set a lower priority, and schedule it so it starts a minute (or few) later than your other jobs. Put the Run After only on that last job.

For example, let's say you have job1, job2, job3, job4 and job5. job1-4 would have priority=10, and job5 would have priority=20 and Run After. What would happen is bacula will queue job1-4 to at the same time, but run them one by one (due to Maximum Concurrent Jobs = 1). Only when all of them complete, would a job5 be run (due to Allow Mixed Priority=no it will wait for all higher priority jobs to complete before it starts), and only when job5 completes, will bacula run Run After Job script). So, the script will be run only after all of job1-5 complete.

You can even keep concurrency higher than 1, if you want to run several jobs in parallel - it would still work.

| improve this answer | |
  • looks like it should work) – Sergey Oct 7 '14 at 20:24

Put all of your related jobs into a single script and then use Run After.

| improve this answer | |
  • What do you mean? How can I put bacula jobs configs into a script? – Sergey Sep 21 '12 at 2:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.