/[BackupPC]/trunk/bin/BackupPC_updatedb
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_updatedb

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 14 by dpavlin, Sun Jul 10 22:56:43 2005 UTC revision 18 by dpavlin, Mon Jul 11 14:31:51 2005 UTC
# Line 81  if ($opt{c}) { Line 81  if ($opt{c}) {
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,
# Line 186  foreach my $host_key (keys %{$hosts}) { Line 186  foreach my $host_key (keys %{$hosts}) {
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();
# Line 256  sub found_in_db { Line 256  sub found_in_db {
256          my @param = ($shareID,$path,$name,$date,$size);          my @param = ($shareID,$path,$name,$date,$size);
257          $sth->{file_in_db}->execute(@param);          $sth->{file_in_db}->execute(@param);
258          my ($rows) = $sth->{file_in_db}->fetchrow_array();          my ($rows) = $sth->{file_in_db}->fetchrow_array();
259          print STDERR ( $rows ? '+' : '-' ), join(" ",@param), "\n";  #       print STDERR ( $rows ? '+' : '-' ), join(" ",@param), "\n";
260          return $rows;          return $rows;
261  }  }
262    
# Line 298  sub recurseDir($$$$$$$$) { Line 298  sub recurseDir($$$$$$$$) {
298    
299                  if (! $beenThere->{$key} && ! found_in_db(@data)) {                  if (! $beenThere->{$key} && ! found_in_db(@data)) {
300                          $sth->{'insert_files'}->execute(@data);                          $sth->{'insert_files'}->execute(@data);
301                          print STDERR "$key\n";  #                       print STDERR "$key\n";
302                          if ($filesInBackup->{$path_key}->{'type'} == BPC_FTYPE_DIR) {                          if ($filesInBackup->{$path_key}->{'type'} == BPC_FTYPE_DIR) {
303                                  $new_dirs++;                                  $new_dirs++;
304                          } else {                          } else {

Legend:
Removed from v.14  
changed lines
  Added in v.18

  ViewVC Help
Powered by ViewVC 1.1.26