/[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 157 by dpavlin, Mon Oct 10 13:04:51 2005 UTC revision 158 by dpavlin, Mon Oct 10 13:39:10 2005 UTC
# Line 61  sub curr_time { Line 61  sub curr_time {
61  my $sth = $dbh->prepare( qq{  my $sth = $dbh->prepare( qq{
62                    
63  select  select
64            backups.id as backup_id,
65          hosts.name as host,          hosts.name as host,
66          shares.name as share,          shares.name as share,
67          num as num          backups.num as num
68  from backups  from backups
69          join shares on backups.hostid = shares.hostid          join shares on backups.hostid = shares.hostid
70                  and shares.id = backups.shareid                  and shares.id = backups.shareid
# Line 75  order by backups.date Line 76  order by backups.date
76    
77  $sth->execute();  $sth->execute();
78    
79    my $sth_inc_size = $dbh->prepare(qq{ update backups set inc_size = ? where id = ? });
80    
81  %BackupPC::SearchLib::Conf = %Conf;  %BackupPC::SearchLib::Conf = %Conf;
82    
83  while (my $row = $sth->fetchrow_hashref) {  while (my $row = $sth->fetchrow_hashref) {
# Line 88  while (my $row = $sth->fetchrow_hashref) Line 91  while (my $row = $sth->fetchrow_hashref)
91    
92          system($cmd) == 0 or die "failed: $?";          system($cmd) == 0 or die "failed: $?";
93    
94          print fmt_time(time() - $t),"\n";          my $size = (stat( "$tar_dir/$tar_file" ))[7];
95    
96            print fmt_time(time() - $t)," $size bytes\n";
97    
98            $sth_inc_size->execute($size, $row->{'backup_id'});
99    
100            $dbh->commit;
101    
102  }  }
103    

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

  ViewVC Help
Powered by ViewVC 1.1.26