baclua-backup-dirs uses /proc/self/mountinfo to find out which mount
points should be backed up, since that's the place to find out about
bind mounts and such in Wheezy and up.
This probably doesn't work so well on kFreeBSD, so we should find a
better solution for them.
--- /dev/null
+#! /usr/bin/python
+
+import re
+
+MI_RE = re.compile(r'(?P<mountid>\d+) (?P<parentid>\d+) (?P<majorminor>\d+:\d+) (?P<root>\S+) (?P<mountpoint>\S+) (?P<options>\S+) (?P<optional>(?:\S+\s)+ )?- (?P<fstype>\S+) (?P<mountsrc>\S+) (?P<superopts>\S+)')
+
+for line in file("/proc/self/mountinfo"):
+ mi = MI_RE.match(line)
+ if mi is None:
+ # XXX: handle error?
+ continue
+ gd = mi.groupdict()
+ # Skip bind mounts
+ if gd.get("root") != "/":
+ continue
+ if gd.get("fstype") not in [ "ext2", "ext3", "ext4", "xfs", "jfs"]:
+ continue
+ print gd["mountpoint"]
require => Package['bacula-fd'],
notify => Service['bacula-fd'],
}
+ file { '/usr/local/sbin/bacula-backup-dirs':
+ mode => '0775',
+ source => 'puppet:///modules/bacula/bacula-backup-dirs',
+ }
file { '/usr/local/sbin/postbaculajob':
mode => '0775',
source => 'puppet:///modules/bacula/postbaculajob',
signature = SHA1
compression = GZIP9
}
- File = "\\|bash -c \"df -Pkl -x tmpfs -x iso9660 | tail -n +2 | awk '{print \$NF}' \""
+ File = "|/usr/local/sbin/bacula-backup-dirs"
# Dont backup directories that contain .nobackup files
Exclude Dir Containing = .nobackup
}