From 873eb70ef87abfeaace2f4b0020626d01ad1bfe5 Mon Sep 17 00:00:00 2001 From: Antoine Beaupré Date: Wed, 22 Apr 2015 17:52:27 -0400 Subject: fix non-rdiff backup checks --- files/checkbackups.pl | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/files/checkbackups.pl b/files/checkbackups.pl index 50a985c..3991446 100755 --- a/files/checkbackups.pl +++ b/files/checkbackups.pl @@ -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); -- cgit v1.2.3