#!/usr/bin/perl
+# Read all the configuration files and check that all filesystems
+# are either backed up in both full and incremental dumps or
+# listed as exceptions.
+
BEGIN {
$etc= '/etc/backup';
require "$etc/settings.pl";
}
}
print "\n";
- $!=0; close(X); $? and die "$cmd $? $!";
+ $!=0; close(X); $? and die "$? $!";
}
foreach $fsg (keys %usedkb) {
print "filesystem group $fsg: $usedkb{$fsg} 1K-blocks$unkkb{$fsg}\n";
}
+# We check that all mounted filesystems are dumped and all
+# filesystems to be dumped are mounted. The expected-diffs
+# config file allows us to make exceptions.
+# eg:
+# #expect disk2 to be mounted but not dumped
+# !/disk2
+# # CD may or may not be mounted but should not be dumped in either case
+# ?/cdrom
+
open Z,"$etc/expected-diffs" or die $!;
for (;;) {
$_= <Z> or die; chomp; s/\s*$//;
last if m/^end$/;
next unless m/^\S/;
next if m/^\#/;
- if (s/^\!//) {
+ if (s/^\?//) {
+ print "non-permanent filesystem expected not to be dumped: $_\n";
+ if (defined($mounted{$_})) {
+ delete $mounted{$_};
+ }
+ } elsif (s/^\!//) {
&e("expected not to be dumped, but not a mount point: $_")
unless defined($mounted{$_});
print "filesystem expected not to be dumped: $_\n";