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 |
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) { |
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 |
|
|