Changeset 7381

Show
Ignore:
Timestamp:
11/08/04 12:52:04 (4 years ago)
Author:
rambo
Message:

made less noisy by default

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/tools/backup/nnbup_create_archive.pl

    r7018 r7381  
    2828       if (!$backupDir) { $backupDir=$val; } else { print "NOTICE: BackupDir already defined, cannot redefine\n";  } 
    2929       if (!(substr($backupDir,-1,1)eq"/")) { $backupDir.="/"; } 
     30    } elsif ($op eq 'verbose') { 
     31       $opmatch=1; 
     32       $verbose=1; 
    3033    } elsif ($op eq 'archiveid') { 
    3134       $opmatch=1; 
     
    4043          $cmd.=" -p'$mysqlPwd'"; 
    4144       } 
    42        print "INFO: Backing up MySQL database '$val'\n"; 
     45       if ($verbose==1) { print "INFO: Backing up MySQL database '$val'\n"; } 
    4346       $pathFile=$backupDir.$val."_backup_".$time_hr.".sql"; 
    4447       $cnt=@files; 
     
    5659    } elsif ($op eq 'dir') { 
    5760       $opmatch=1; 
    58        print "INFO: Backing up directory '$val'\n"; 
     61       if ($verbose==1) { print "INFO: Backing up directory '$val'\n"; } 
    5962       if (substr($val,0,1) eq "/") { $dirSafe=substr($val,1); } else { $dirSafe=$val; } 
    6063       $_=$dirSafe; 
     
    6770       $cnt=@files_wopath; 
    6871       @files_wopath[$cnt]=$file; 
    69        $cmd="tar -cvf '".$pathFile."' '$val'"; 
     72       if ($verbose==1) {  
     73          $cmd="tar -cvf '".$pathFile."' '$val'";  
     74       } else { 
     75          $cmd="tar -cf '".$pathFile."' '$val'";  
     76       } 
    7077    } 
    7178    if (!$opmatch) {  
     
    8390$pathMainarchive=$backupDir.$time_hr."_".$archiveId.".tar.bz2"; 
    8491 
    85 $cmd="cd $backupDir; tar -cvjf ".$pathMainarchive." @files_wopath"; 
    86 print "INFO: Compressing the main archive (this might take a while)\n"; 
     92if ($verbose==1) { 
     93   $cmd="cd $backupDir; tar -cvjf ".$pathMainarchive." @files_wopath"; 
     94} else { 
     95   $cmd="cd $backupDir; tar -cjf ".$pathMainarchive." @files_wopath"; 
     96
     97if ($verbose==1) { print "INFO: Compressing the main archive (this might take a while)\n"; } 
    8798#print "DEBUG: main tar.bz2 cmd='$cmd'\n"; 
    8899system($cmd); 
    89100$rmcmd="rm -f @files"; 
    90 print "INFO: Removing temporary files\n"; 
     101if ($verbose==1) { print "INFO: Removing temporary files\n"; } 
    91102#print "DEBUG: rmcmd='$rmcmd'\n"; 
    92103system ($rmcmd); 
  • trunk/src/tools/backup/nnbup_main.pl

    r7018 r7381  
    4242       $opmatch=1; 
    4343       if (!$archiveId) { $archiveId=$val; } else { print "NOTICE: ArchiveID already defined, cannot redefine\n"; } 
     44    } elsif ($op eq 'verbose') { 
     45       $opmatch=1; 
     46       $verbose=1; 
    4447    } 
    4548    if (!$opmatch) {  
     
    5861 
    5962if ($monthday==$monthlyDay) { #It's time to make also a monthly copy 
    60    print "INFO: Copying todays archive to monthly archives\n"; 
     63   if ($verbose==1) { print "INFO: Copying todays archive to monthly archives\n"; } 
    6164   $month_hr=($year+1900).sprintf("%02d%02d",($month+1, $monthday)); 
    6265   $pathFile=$backupDir."Monthly-".$month_hr."_".$archiveId.".tar.bz2"; 
     
    6770 
    6871# *** NEXT UP: Go trough existing files and eliminate old ones 
    69 printf ("INFO: Clearing files older than %d days\n",$keepDays); 
     72if ($verbose==1) { printf ("INFO: Clearing files older than %d days\n",$keepDays); } 
    7073if ($backupDir) { 
    7174   $_=$backupDir;