How to cascade jobs?

23 views
Skip to first unread message

moose

unread,
Jan 5, 2020, 8:18:24 AM1/5/20
to bareos-users
Hi folks,

I've Bareos dir and sd installed on different machines. While dir machine (vm) is running around the clock the sd one doesn't because I only need sd twice a day for a few minutes/hours. On the other hand the sd machines consomes much more energy because it's a hw device with big zfs disk pool.

In general, I start all my backup jobs lets say at 12 a.m. and p.m. This I'd like to do by scheduler. So far so good.

What I want to do are two things:
  1. start the machine with the sd by wakeonlan before starting all my (scheduled) bareos jobs, keep it up and running until the last one has finished and shutdown it afterwards

  2. I need a solution which boots the sd machine and shuts its down after any job (anyway if backup or restore) which has been startet not by scheduler but manually by WebUI or bconsole.
Of course, there are Run Before and Run After commands which can be used in the job definitions. But if I would use them for each job the sd machine will be booted and shutted down a couple of time during each backup period.

So my first idea is to cascade the jobs. But, how to do it in Bareos?

May be some of you guys has or has had a similar task and will reply his suggestions/solutions to me. But, any other practical solution would also be greatly apreciated!

Many thanks in advance

moose

Jörg Steffens

unread,
Jan 13, 2020, 10:03:15 AM1/13/20
to bareos...@googlegroups.com
On 05.01.20 at 14:18 wrote moose:
> Hi folks,
>
> I've Bareos dir and sd installed on different machines. While dir
> machine (vm) is running around the clock the sd one doesn't because I
> only need sd twice a day for a few minutes/hours. On the other hand the
> sd machines consomes much more energy because it's a hw device with big
> zfs disk pool.
>
> In general, I start all my backup jobs lets say at 12 a.m. and p.m. This
> I'd like to do by scheduler. So far so good.
>
> What I want to do are two things:
>
> 1. start the machine with the sd by wakeonlan *before* starting all my
> (scheduled) bareos jobs, keep it up and running until the last one
> has finished and shutdown it afterwards
>
> 2. I need a solution which boots the sd machine and shuts its down
> after any job (anyway if backup or restore) which has been startet
> not by scheduler but manually by WebUI or bconsole.
>
> Of course, there are *Run Before* and *Run After *commands which can be
> used in the job definitions. But if I would use them for each job the sd
> machine will be booted and shutted down a couple of time during each
> backup period.
>
> So my first idea is to cascade the jobs. But, how to do it in Bareos?
>
> May be some of you guys has or has had a similar task and will reply his
> suggestions/solutions to me. But, any other practical solution would
> also be greatly apreciated!

Well, that is definitively not the way Bareos is intended to be used.
Placing the Director and the Sd on the same host may be the best option,
as then backups are only started, when the Sd is available.

However, Bareos does offer some flexibility.

Option 1:
You could us a job that have a Run Script that handles this for use.
The shell script would then:

wol bareos-sd
bconsole <<< "
run job=backaup1 yes
run job=backaup2 yes
...
wait
"
shutdown bareos-sd

The wait command will wait until all jobs are finished.

Option 2:
Instead of running the jobs manually, you could use the "enable schedule
..." / "disable schedule ..." commands, to guarantee that jobs are only
automatically executed, when the sd is running.

Option 3:
For manually started jobs, you could use a Run Script (best definied the
a JobDef and inherited to all jobs), that does the wol on the Sd.

Option 4:
Write a cron job. When "list jobs jobstatus=R" lists running jobs, wol
the Sd. If not, shutdown the sd.


Regards,
Jörg

--
Jörg Steffens joerg.s...@bareos.com
Bareos GmbH & Co. KG Phone: +49 221 630693-91
http://www.bareos.com Fax: +49 221 630693-10

Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
Komplementär: Bareos Verwaltungs-GmbH
Geschäftsführer:
S. Dühr, M. Außendorf, Jörg Steffens, P. Storz

Reply all
Reply to author
Forward
0 new messages