1

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?

Sergey
  • 714
  • 2
  • 6
  • 21

2 Answers2

2

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.

Matija Nalis
  • 2,409
  • 23
  • 37
1

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

MDMarra
  • 100,183
  • 32
  • 195
  • 326