]> jspc29.x-matter.uni-frankfurt.de Git - hadesicinga.git/commitdiff
Dir count fixed. Sergey.
authorhadaq <hadaq>
Tue, 11 May 2010 10:34:01 +0000 (10:34 +0000)
committerhadaq <hadaq>
Tue, 11 May 2010 10:34:01 +0000 (10:34 +0000)
plugins/check_backup.pl

index aa24c3488f951b82fd5f2edced69886a58138e9f..376ea60630c0ed122eff73ff955553ba88675781 100755 (executable)
@@ -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 ++;
                }
            }