/[BackupPC]/trunk/bin/BackupPC_incPartsUpdate
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/bin/BackupPC_incPartsUpdate

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 212 by dpavlin, Sun Oct 16 12:33:00 2005 UTC revision 213 by dpavlin, Sun Oct 16 12:33:02 2005 UTC
# Line 82  order by backups.date Line 82  order by backups.date
82    
83  } );  } );
84    
 $sth->execute();  
   
85  my $sth_inc_size = $dbh->prepare(qq{ update backups set inc_size = ?, parts = ? where id = ? });  my $sth_inc_size = $dbh->prepare(qq{ update backups set inc_size = ?, parts = ? where id = ? });
86  my $sth_inc_deleted = $dbh->prepare(qq{ update backups set inc_deleted = ? where id = ? });  my $sth_inc_deleted = $dbh->prepare(qq{ update backups set inc_deleted = ? where id = ? });
87    
88  %BackupPC::SearchLib::Conf = %Conf;  %BackupPC::SearchLib::Conf = %Conf;
89    
90    $sth->execute();
91    my $num_backups = $sth->rows;
92    my $curr_backup = 1;
93    
94  while (my $row = $sth->fetchrow_hashref) {  while (my $row = $sth->fetchrow_hashref) {
95          my $tar_file = BackupPC::SearchLib::getGzipName($row->{'host'}, $row->{'share'}, $row->{'num'});          my $tar_file = BackupPC::SearchLib::getGzipName($row->{'host'}, $row->{'share'}, $row->{'num'});
96    
97          # this will return -1 if file doesn't exist          # this will return -1 if file doesn't exist
98          my $size = BackupPC::SearchLib::get_tgz_size_by_name($tar_file);          my $size = BackupPC::SearchLib::get_tgz_size_by_name($tar_file);
99    
100          print curr_time, " ", $row->{'host'}, ":", $row->{'share'}, " #", $row->{'num'}, " -> $tar_file";          print curr_time, " $curr_backup/$num_backups ", $row->{'host'}, ":", $row->{'share'}, " #", $row->{'num'}, " -> $tar_file";
101            $curr_backup++;
102    
103          my $t = time();          my $t = time();
104    
# Line 106  while (my $row = $sth->fetchrow_hashref) Line 109  while (my $row = $sth->fetchrow_hashref)
109    
110                  system($cmd) == 0 or die "failed: $?";                  system($cmd) == 0 or die "failed: $?";
111    
112                  rename "${tar_dir}/${$tar_file}.tmp", "$tar_dir/$tar_file" or die "can't rename $tar_dir/$tar_file: $!";                  rename("${tar_dir}/${tar_file}.tmp", "$tar_dir/$tar_file") or die "can't rename $tar_dir/$tar_file: $!";
113    
114                  $size = (stat( "$tar_dir/$tar_file" ))[7];                  $size = (stat( "$tar_dir/$tar_file" ))[7];
115          }          }

Legend:
Removed from v.212  
changed lines
  Added in v.213

  ViewVC Help
Powered by ViewVC 1.1.26