/[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 158 by dpavlin, Mon Oct 10 13:39:10 2005 UTC revision 168 by dpavlin, Mon Oct 10 14:11:10 2005 UTC
# Line 19  my $tarIncCreate = $path .= 'BackupPC_ta Line 19  my $tarIncCreate = $path .= 'BackupPC_ta
19    
20  die "can't find $tarIncCreate: $!\n" unless (-x $tarIncCreate);  die "can't find $tarIncCreate: $!\n" unless (-x $tarIncCreate);
21    
22  my $debug = 1;  my $debug = 0;
23  $|=1;  $|=1;
24    
25  my $start_t = time();  my $start_t = time();
# Line 77  order by backups.date Line 77  order by backups.date
77  $sth->execute();  $sth->execute();
78    
79  my $sth_inc_size = $dbh->prepare(qq{ update backups set inc_size = ? where id = ? });  my $sth_inc_size = $dbh->prepare(qq{ update backups set inc_size = ? where id = ? });
80    my $sth_inc_deleted = $dbh->prepare(qq{ update backups set inc_deleted = ? where id = ? });
81    
82  %BackupPC::SearchLib::Conf = %Conf;  %BackupPC::SearchLib::Conf = %Conf;
83    
# Line 93  while (my $row = $sth->fetchrow_hashref) Line 94  while (my $row = $sth->fetchrow_hashref)
94    
95          my $size = (stat( "$tar_dir/$tar_file" ))[7];          my $size = (stat( "$tar_dir/$tar_file" ))[7];
96    
97          print fmt_time(time() - $t)," $size bytes\n";          print " dur: ",fmt_time(time() - $t)," $size bytes";
98    
99          $sth_inc_size->execute($size, $row->{'backup_id'});          if ($size > 45) {
100                    $sth_inc_size->execute($size, $row->{'backup_id'});
101                    $sth_inc_deleted->execute(0, $row->{'backup_id'});
102            } else {
103                    $sth_inc_deleted->execute(1, $row->{'backup_id'});
104                    unlink "$tar_dir/$tar_file" || die "can't delete $tar_dir/$tar_file: $!\n";
105                    print " EMPTY";
106            }
107            print "\n";
108    
109          $dbh->commit;          $dbh->commit;
110    

Legend:
Removed from v.158  
changed lines
  Added in v.168

  ViewVC Help
Powered by ViewVC 1.1.26