From: hadaq Date: Tue, 11 May 2010 10:34:01 +0000 (+0000) Subject: Dir count fixed. Sergey. X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=f4fbe07b8b69d618a65a64830b79e110a9ea5cec;p=hadesicinga.git Dir count fixed. Sergey. --- diff --git a/plugins/check_backup.pl b/plugins/check_backup.pl index aa24c34..376ea60 100755 --- a/plugins/check_backup.pl +++ b/plugins/check_backup.pl @@ -27,6 +27,7 @@ my @items; my $count = 0; my $status : shared = "OK"; my @screenPID; +my $backup_dir = "/data/hadeb04/backup/.snapshots"; my @backup_list = ("depc234", "hadeb05", @@ -57,16 +58,17 @@ sub main { while(1){ #--- check the presence of all 5 directories inside - my @array = `ls /data/backup/.snapshots/hourly.0/`; + my @array = `ls $backup_dir/hourly.0/`; #--- check time of only the latest dir: hourly.0 - my @dir = `ls -ltr /data/backup/.snapshots/`; + my @dir = `ls -ltr $backup_dir/`; - foreach my $line (@array) - { + foreach my $line (@array) { + chop($line); + #--- count directories foreach my $bdir (@backup_list){ - if( $line =~ /($bdir)/ ){ + if( $line eq $bdir ){ $count ++; } }