]> gitweb.fluxo.info Git - puppet-backupninja.git/commitdiff
fix non-rdiff backup checks
authorAntoine Beaupré <anarcat@koumbit.org>
Wed, 22 Apr 2015 21:52:27 +0000 (17:52 -0400)
committerAntoine Beaupré <anarcat@koumbit.org>
Wed, 22 Apr 2015 21:58:51 +0000 (17:58 -0400)
files/checkbackups.pl

index 50a985ca7b83f4a7b2ca6faba006c1f1fd75f161..39914469315eb29154545e696b780d7410dd075f 100755 (executable)
@@ -164,16 +164,13 @@ foreach $host (@hosts) {
        if (-d $dir) {
                 # guess the backup type and find a proper stamp file to compare
                 @rdiffs = glob("$dir/*/rdiff-backup-data");
-                foreach $dir (@rdiffs) {
-                    $opt_v && print STDERR "inspecting dir $dir\n";
-                    $dir =~ s/rdiff-backup-data$//;
-                    check_rdiff($host, $dir, $opt_v);
+                foreach $subdir (@rdiffs) {
+                    $subdir =~ s/rdiff-backup-data$//;
+                    $opt_v && print STDERR "inspecting dir $subdir\n";
+                    check_rdiff($host, $subdir, $opt_v);
                     $flag = 1;
                 }
-               if (-d "$dir/rdiff-backup") {
-                    check_rdiff($host, $dir . '/rdiff-backup', $opt_v);
-                    $flag = 1;
-               } elsif (-d "$dir/dump") {
+               if (-d "$dir/dump") {
                        # XXX: this doesn't check backup consistency
                        $flag="$dir/dump/" . `ls -tr $dir/dump | tail -1`;
                        chomp($flag);