On 12.11.2019 09:11, Jörg Steffens wrote:
On 12.11.19 at 07:59 wrote Spadajspadaj:
Hi there.

I added a laptop client to my bareos setup and everything runs mostly
fine except for the fact that if the job is scheduled for - let's say -
9pm, it tries to run, tries to connect to fd and since the laptop is
down, the job fails.

I was wondering how I can avoid those failed jobs and possibly have
bareos server wait for a client to appear.

I pondered two options:

1) Have completely manual "schedule", so the job never runs on its own.
I need to manually run the job every time I have a laptop available in
my network. But I'm not sure I can specify a schedule which never runs
on its own. Is it even possible? Or

2) Have bareos server wait for the fd to appear on the network. Now
that's trickier. I thought about writing a script and running it as a
pre-job script effectively delaying start of the job itself until I can
reach the fd but:

a) I'm not sure if the pre-job script is run before the initial
connection to fd or after. (haven't tried it yet; just thought about it
today driving to work :-)) and

b) If I understand correctly, such job with a pre-job script would
effectively block other jobs from running in the same time, right? So if
I have a schedule for all jobs to start at 9pm, then other jobs (for now
let's not complicate matters with priorities) would wait for my script
to time-out with the Max Run Time limit?

Any other ideas?

What I would ideally want to achieve is to have bareos do a backup of my
laptop when it gets available on the network (when I come back home and
power on the laptop) but of course not more than once a day.

Of course I can (and probably will if there are no other options) do an
external script which probes the network for the laptop and if found
runs the apropriate job but I was wondering if I can do something like
that "from within" bareos.
You can solve this with a combination of
https://docs.bareos.org/TasksAndConcepts/NetworkSetup.html#client-initiated-connection
and the external script
https://github.com/bareos/bareos-contrib/blob/master/misc/triggerjob/triggerjob.py
run by cron.

Triggerjob will look for all clients connected to the Director.
If is finds a job named backup-{clientname} that did not successfully
run during the specified time period, it will trigger this job.

The upcoming Bareos 19.2.4 will also add an additional feature to the
Bareos core.

Thanks for suggestions. I'll look into it :-)

MK


--
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bareos-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bareos-users/c35f71cb-9173-808f-93e9-552da91dbcb9%40gmail.com.

Reply via email to