/[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 162 by dpavlin, Mon Oct 10 13:39:14 2005 UTC revision 172 by dpavlin, Tue Oct 11 16:00:02 2005 UTC
# Line 8  use BackupPC::Lib; Line 8  use BackupPC::Lib;
8  use BackupPC::View;  use BackupPC::View;
9  use Data::Dumper;  use Data::Dumper;
10  use Time::HiRes qw/time/;  use Time::HiRes qw/time/;
 use File::Pid;  
11  use POSIX qw/strftime/;  use POSIX qw/strftime/;
12  use BackupPC::SearchLib;  use BackupPC::SearchLib;
13  use Cwd qw/abs_path/;  use Cwd qw/abs_path/;
# Line 77  order by backups.date Line 76  order by backups.date
76  $sth->execute();  $sth->execute();
77    
78  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 = ? });
79    my $sth_inc_deleted = $dbh->prepare(qq{ update backups set inc_deleted = ? where id = ? });
80    
81  %BackupPC::SearchLib::Conf = %Conf;  %BackupPC::SearchLib::Conf = %Conf;
82    
# Line 93  while (my $row = $sth->fetchrow_hashref) Line 93  while (my $row = $sth->fetchrow_hashref)
93    
94          my $size = (stat( "$tar_dir/$tar_file" ))[7];          my $size = (stat( "$tar_dir/$tar_file" ))[7];
95    
96          print " dur: ",fmt_time(time() - $t)," $size bytes\n";          print " dur: ",fmt_time(time() - $t)," $size bytes";
97    
98          $sth_inc_size->execute($size, $row->{'backup_id'});          if ($size > 45) {
99                    $sth_inc_size->execute($size, $row->{'backup_id'});
100                    $sth_inc_deleted->execute(0, $row->{'backup_id'});
101            } else {
102                    $sth_inc_deleted->execute(1, $row->{'backup_id'});
103                    unlink "$tar_dir/$tar_file" || die "can't delete $tar_dir/$tar_file: $!\n";
104                    print " EMPTY";
105            }
106            print "\n";
107    
108          $dbh->commit;          $dbh->commit;
109    

Legend:
Removed from v.162  
changed lines
  Added in v.172

  ViewVC Help
Powered by ViewVC 1.1.26