Robert N <[email protected]> writes:
> Hi Everybody,
>
> I'm using bareos to backup Linux servers. I have bind mounts on the
> servers and using the following Fileset config.
>
> FileSet {
> Name = "StdLinux"
> Include {
> Options {
> compression = GZIP
> noatime = yes
> signature = MD5 # calculate md5 checksum per file
> sparse = yes
> One FS = No # change into other filessytems
> FS Type = ext2 # filesystems of given types will be backed up
> FS Type = ext3 # others will be ignored
> FS Type = ext4
> }
> File = /
> }
> }
>
>
> Although I specify to backup only mounts of type ext2,3,4 the bind
> mounts are backed up twice. Once in the source of the mount and once
> in the destination.
>
> Is there a way to exclude bind mounts, not on individual basis, but on
> type basis?
>
> As far as I can see, the mount command reports fs type none for bind
> mounts.
I haven't double checked the code, but the traditional way to discover
that you are recursing into a different mount point is to notice that
the device value from stat(2) is different. with bind mounts, stat will
return the same device. an example (without bind mount, but):
$ stat --format %D / /tmp /usr
fd01
28
fd01
to accomplish what you want, I think you need to use the feature of
running a shell command on the client to provide a dynamic exclusion
list. here's suggested code, it will exclude all mount points which
have the same device as a mount point earlier in the df output:
Include {
File = "\\|sh -c \"df -P | awk '\$1 in seen {print \$6} {seen[\$1] = 1}'\""
}
(quoting is a pain, I hope I got it right above. it may be better to
put the code in a small script on each client.)
--
Kjetil T. Homme
Redpill Linpro AS - Changing the game
--
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 post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.