/[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 50 by dpavlin, Sat Aug 20 15:51:16 2005 UTC revision 51 by dpavlin, Sat Aug 20 16:40:11 2005 UTC
# Line 17  use constant BPC_FTYPE_DIR => 5; Line 17  use constant BPC_FTYPE_DIR => 5;
17  my $debug = 0;  my $debug = 0;
18  $|=1;  $|=1;
19    
20    my $start_t = time();
21    
22  my $pidfile = new File::Pid;  my $pidfile = new File::Pid;
23    
24  if (my $pid = $pidfile->running ) {  if (my $pid = $pidfile->running ) {
# Line 36  my %Conf = $bpc->Conf(); Line 38  my %Conf = $bpc->Conf();
38  my $TopDir = $bpc->TopDir();  my $TopDir = $bpc->TopDir();
39  my $beenThere = {};  my $beenThere = {};
40    
41  my $dsn = "dbi:SQLite:dbname=$TopDir/$Conf{SearchDB}";  my $dsn = $Conf{SearchDSN} || die "Need SearchDSN in config.pl\n";
42  my $user = '';  my $user = $Conf{SearchUser} || '';
   
 # DEBUG option!  
 ($dsn,$user) = qw/dbi:Pg:dbname=backuppc dpavlin/;  
43    
44  my $dbh = DBI->connect($dsn, $user, "", { RaiseError => 1, AutoCommit => 0 });  my $dbh = DBI->connect($dsn, $user, "", { RaiseError => 1, AutoCommit => 0 });
45    
# Line 156  if ($opt{d}) { Line 155  if ($opt{d}) {
155          }          }
156          print " done...\n";          print " done...\n";
157    
158          eval { $dbh->commit; };          $dbh->commit;
159  }  }
160    
161  if ($opt{v}) {  if ($opt{v}) {
# Line 279  undef $sth; Line 278  undef $sth;
278  $dbh->commit();  $dbh->commit();
279  $dbh->disconnect();  $dbh->disconnect();
280    
281    print "total duration: ",fmt_time(time() - $start_t),"\n";
282    
283  $pidfile->remove;  $pidfile->remove;
284    
285  sub getShareID() {  sub getShareID() {

Legend:
Removed from v.50  
changed lines
  Added in v.51

  ViewVC Help
Powered by ViewVC 1.1.26