On 11/12/19 12:42 AM, Spadajspadaj wrote:
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
I found a solution for my own backups by using the retry approach. I
placed these directives in my jobdefs for the jobs that might fail
because the VM's (clients) are down:
RerunFailedLevels = yes
RescheduleOnError = yes
RescheduleInterval = 6 hours
RescheduleTimes = 3
AllowDuplicateJobs = no
CancelQueuedDuplicates = yes
The last 2 directives may not be necessary, but it helps prevent bogging
down bareos. So what this does is re-try error'd jobs 3 times: Once
after 6 hours, then 12 hours, and then 18 hours after the original
attempt failed. By the time the 4th re-try would re-occur, we are
already into the next day, so it would be pointless to retry it a 4th time.
You might read about these in the docs to fully understand them. BTW,
I've been using this "recipe" for about 3 years now without problems.
I'm running bareos 16.2 director and storage daemons, with varying
bareos-fd clients.
Good luck.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/bareos-users/d6aba5db-dbaf-b1ed-ceaa-85b9854c51bb%40mail.com.