$sth->{insert_backups} = $dbh->prepare(qq{
INSERT INTO backups (hostID, num, date, type, shareid, size)
-VALUES (?,?,?,?,?,?)
+VALUES (?,?,?,?,?,-1)
+});
+
+$sth->{update_backups_size} = $dbh->prepare(qq{
+UPDATE backups SET size = ?
+WHERE hostID = ? and num = ? and date = ? and type =? and shareid = ?
});
$sth->{insert_files} = $dbh->prepare(qq{
# dump some log
print curr_time," ", $share;
- my ($f, $nf, $d, $nd, $size) = recurseDir($bpc, $hostname, $files, $backupNum, $share, "", $shareID);
-
$sth->{insert_backups}->execute(
$hostID,
$backupNum,
$backup->{'endTime'},
substr($backup->{'type'},0,4),
$shareID,
+ );
+
+ my ($f, $nf, $d, $nd, $size) = recurseDir($bpc, $hostname, $files, $backupNum, $share, "", $shareID);
+
+ $sth->{update_backups_size}->execute(
$size,
+ $hostID,
+ $backupNum,
+ $backup->{'endTime'},
+ substr($backup->{'type'},0,4),
+ $shareID,
);
print " commit";
# daylight saving time change offset for 1h
my $dst_offset = 60 * 60;
- my $key_dst1 = join(" ", (
+ my $key_dst_prev = join(" ", (
$shareID,
$dir,
$path_key,
$filesInBackup->{$path_key}->{'size'}
));
- my $key_dst2 = join(" ", (
+ my $key_dst_next = join(" ", (
$shareID,
$dir,
$path_key,
my $found;
if (
! defined($beenThere->{$key}) &&
- ! defined($beenThere->{$key_dst1}) &&
- ! defined($beenThere->{$key_dst2}) &&
+ ! defined($beenThere->{$key_dst_prev}) &&
+ ! defined($beenThere->{$key_dst_next}) &&
! ($found = found_in_db($key, @data))
) {
print STDERR "# key: $key [", $beenThere->{$key},"]" if ($debug >= 2);