81 |
create table files ( |
create table files ( |
82 |
ID INTEGER NOT NULL PRIMARY KEY, |
ID INTEGER NOT NULL PRIMARY KEY, |
83 |
shareID INTEGER NOT NULL references shares(id), |
shareID INTEGER NOT NULL references shares(id), |
84 |
backupNum INTEGER NOT NULL references backups(id), |
backupNum INTEGER NOT NULL references backups(num), |
85 |
name VARCHAR(255) NOT NULL, |
name VARCHAR(255) NOT NULL, |
86 |
path VARCHAR(255) NOT NULL, |
path VARCHAR(255) NOT NULL, |
87 |
fullpath VARCHAR(255) NOT NULL, |
fullpath VARCHAR(255) NOT NULL, |
186 |
my $backupNum = $backup->{'num'}; |
my $backupNum = $backup->{'num'}; |
187 |
my @backupShares = (); |
my @backupShares = (); |
188 |
|
|
189 |
print $hosts->{$host_key}->{'host'},"\t$backupNum\n"; |
print $hosts->{$host_key}->{'host'},"\t#$backupNum\n"; |
190 |
|
|
191 |
$sth->{backups_broj}->execute($hostID, $backupNum); |
$sth->{backups_broj}->execute($hostID, $backupNum); |
192 |
my ($broj) = $sth->{backups_broj}->fetchrow_array(); |
my ($broj) = $sth->{backups_broj}->fetchrow_array(); |
236 |
VALUES (?,?,?,?) |
VALUES (?,?,?,?) |
237 |
}); |
}); |
238 |
|
|
239 |
$sth->{insert_share}->execute($hostID,$share, $hostname . $share,undef); |
my $drop_down = $hostname . '/' . $share; |
240 |
|
$drop_down =~ s#//+#/#g; |
241 |
|
|
242 |
|
$sth->{insert_share}->execute($hostID,$share, $drop_down ,undef); |
243 |
return $dbh->func('last_insert_rowid'); |
return $dbh->func('last_insert_rowid'); |
244 |
} |
} |
245 |
|
|
259 |
my @param = ($shareID,$path,$name,$date,$size); |
my @param = ($shareID,$path,$name,$date,$size); |
260 |
$sth->{file_in_db}->execute(@param); |
$sth->{file_in_db}->execute(@param); |
261 |
my ($rows) = $sth->{file_in_db}->fetchrow_array(); |
my ($rows) = $sth->{file_in_db}->fetchrow_array(); |
262 |
print STDERR ( $rows ? '+' : '-' ), join(" ",@param), "\n"; |
# print STDERR ( $rows ? '+' : '-' ), join(" ",@param), "\n"; |
263 |
return $rows; |
return $rows; |
264 |
} |
} |
265 |
|
|
301 |
|
|
302 |
if (! $beenThere->{$key} && ! found_in_db(@data)) { |
if (! $beenThere->{$key} && ! found_in_db(@data)) { |
303 |
$sth->{'insert_files'}->execute(@data); |
$sth->{'insert_files'}->execute(@data); |
304 |
print STDERR "$key\n"; |
# print STDERR "$key\n"; |
305 |
if ($filesInBackup->{$path_key}->{'type'} == BPC_FTYPE_DIR) { |
if ($filesInBackup->{$path_key}->{'type'} == BPC_FTYPE_DIR) { |
306 |
$new_dirs++; |
$new_dirs++; |
307 |
} else { |
} else { |