How to get a warning of an unmounted shared folder (without any files or folders)?

5 views
Skip to first unread message

DUCARROZ Birgit

unread,
Feb 24, 2020, 9:52:44 AM2/24/20
to bareos...@googlegroups.com
Hi list,

I try to figure out how to configure bareos to send me a warning or
error message in case of an empty directory.

I.ex. I mount a share from an external server on the bareos server which
I will backup. Let's say this mount in now suddenly unmounted.

Bareos will backup now an empty folder and returns an ok.

Is it possible to make it detect that this folder is empty and to return
a warning?

Thank you so much for any help.

Kind regards,
Birgit

Spadajspadaj

unread,
Feb 24, 2020, 10:10:40 AM2/24/20
to bareos...@googlegroups.com
Bareos is very flexible in terms of preparing a job. You can run a
"pre-job" script. It can be run either on server's side or client's
side. I suppose you'd prefer client's side in this case.

https://docs.bareos.org/Configuration/Director.html#config-Dir_Job_RunScript

And you can fail the backup job if the script returns an error (non-zero
exit status).


Best regards,

MK

DUCARROZ Birgit

unread,
Feb 24, 2020, 10:17:31 AM2/24/20
to Spadajspadaj, bareos...@googlegroups.com
Thank you a lot, I will read this doc and try to figure out how to do it.

Kind regards,
Birgit

Andreas Rogge

unread,
Feb 25, 2020, 6:07:47 AM2/25/20
to bareos...@googlegroups.com
Hi Birgit,

if you have your mointpoint /path/to/mount/point and you backup
/path/to/mount/point there is no easy way to do this. You can use a
script as suggested and this is probably the best solution.

However, if you can configure your Fileset to backup
/path/to/mount/point/mounted-directory/ the backup should at least issue
a warning.

Best Regards,
Andreas

Am 24.02.20 um 15:52 schrieb 'DUCARROZ Birgit' via bareos-users:
--
Andreas Rogge andrea...@bareos.com
Bareos GmbH & Co. KG Phone: +49 221-630693-86
http://www.bareos.com

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. Steffens, Philipp Storz

signature.asc

DUCARROZ Birgit

unread,
Feb 25, 2020, 6:52:24 AM2/25/20
to Andreas Rogge, bareos...@googlegroups.com
Hi Andreas,


On 25/02/20 12:07, Andreas Rogge wrote:
> However, if you can configure your Fileset to backup
> /path/to/mount/point/mounted-directory/ the backup should at least issue
> a warning.

Thank you for your response. I did it as a Fileset, and yes, this is
very easy, and yes, there might be a warning at the first backup with an
empty share.

But once a backup was successful and afterwards the share is unmounted,
I get a "Success" with 0.00 Bytes but no warning.

This means if I don't notice quickly the share is unmounted, I don't
notice there are no backups anymore.

Here an example of my config:
fstab:
nas60:/volumes/student /euronas/student nfs
nfsvers=4,nodev,noexec,nosuid 0 0

Fileset:

File = /euronas/student

So I must find a solution which detects first the empty share and
returns a warning.

Sure, I can check with a script using a cronjob which sends me a mail,
but if I could do it using bareos it would be even smarter :-)

Regards,
Birgit

Andreas Rogge

unread,
Feb 25, 2020, 6:57:11 AM2/25/20
to DUCARROZ Birgit, bareos...@googlegroups.com
Hi Birgit,

if you could mount
nas60:/volumes /euronas
instead of
nas60:/volumes/student /euronas/student
then the student directory only exists when the filesystem is mounted
and a warning would be issued otherwise as the fileset then references a
non-existant directory.

Hope that helps.

Best Regards,
Andreas

Am 25.02.20 um 12:52 schrieb DUCARROZ Birgit:
signature.asc

DUCARROZ Birgit

unread,
Feb 25, 2020, 7:03:22 AM2/25/20
to Andreas Rogge, bareos...@googlegroups.com
Hi Andreas,

Thank you for the hint. I'll have a look how I will manage it. Actually
I'm not sure if my config permits me to cut the share, but once I found
a solution I will post it here.

Kind regards,
Birgit
Reply all
Reply to author
Forward
0 new messages