log mounts

This commit is contained in:
hjp 2010-05-20 09:25:20 +00:00
parent 58b8ab7403
commit fe23839aaf
1 changed files with 2 additions and 0 deletions

View File

@ -33,11 +33,13 @@ my $base_device = $st->dev;
for (glob("/backup/*")) {
my $st = stat($_);
my $dir_device = $st->dev;
$ca->log(0, "checking $_");
if ($base_device == $dir_device) {
# not a mount point
(my $basedir = $_) =~ s{^/backup/}{};
if (-e "/dev/disk/by-id/$basedir") {
# matching device exists
$ca->log(0, "mounting /dev/disk/by-id/$basedir on $_");
system("/bin/mount", "-o", "nodev,noexec,nomand,nosuid", "/dev/disk/by-id/$basedir", $_);
}
}