r8416@llin: dpavlin | 2005-10-10 15:04:13 +0200
authordpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Mon, 10 Oct 2005 13:04:49 +0000 (13:04 +0000)
committerdpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Mon, 10 Oct 2005 13:04:49 +0000 (13:04 +0000)
 added -v flag

git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/BackupPC/trunk@156 8392b6e1-25fa-0310-8288-cc32f8e212ea

bin/BackupPC_tarIncCreate

index 1a53dc6..cffc997 100755 (executable)
@@ -82,7 +82,7 @@ my %opts;
 my $in_backup_increment;
 
 
-if ( !getopts("th:n:p:r:s:b:w:", \%opts) ) {
+if ( !getopts("th:n:p:r:s:b:w:v", \%opts) ) {
     print STDERR <<EOF;
 usage: $0 [options]
   Required options:
@@ -98,6 +98,7 @@ usage: $0 [options]
      -p pathAdd      new path prefix
      -b BLOCKS       BLOCKS x 512 bytes per record (default 20; same as tar)
      -w writeBufSz   write buffer size (default 1048576 = 1MB)
+     -v              verbose output
 EOF
     exit(1);
 }
@@ -391,7 +392,7 @@ sub seedCache($$$) {
        my $dsn = $Conf{SearchDSN};
        my $db_user = $Conf{SearchUser} || '';
        
-       print STDERR curr_time(), "getting files for $host:$share increment $dumpNo...";
+       print STDERR curr_time(), "getting files for $host:$share increment $dumpNo..." if ($opts{v});
        my $sql = q{
                SELECT path
                FROM files
@@ -404,9 +405,9 @@ sub seedCache($$$) {
        my $sth = $dbh->prepare($sql);  
        $sth->execute($host, $share, $dumpNo);
        my $count = $sth->rows;
-       print STDERR " found $count items\n";
+       print STDERR " found $count items\n" if ($opts{v});
        while (my $row = $sth->fetchrow_arrayref) {
-print STDERR "+ ", $row->[0],"\n";
+#print STDERR "+ ", $row->[0],"\n";
                $in_backup_increment->{ $row->[0] }++;
        }
        
@@ -430,7 +431,7 @@ sub TarWriteFile
 
 #print STDERR "? $tarPath\n";
     return unless ($in_backup_increment->{$tarPath});
-print STDERR "A $tarPath\n";
+#print STDERR "A $tarPath\n";
 
     if ( defined($PathRemove)
             && substr($tarPath, 0, length($PathRemove)) eq $PathRemove ) {