--- trunk/bin/BackupPC_updatedb 2005/08/20 15:51:16 50 +++ trunk/bin/BackupPC_updatedb 2005/08/20 16:40:11 51 @@ -17,6 +17,8 @@ my $debug = 0; $|=1; +my $start_t = time(); + my $pidfile = new File::Pid; if (my $pid = $pidfile->running ) { @@ -36,11 +38,8 @@ my $TopDir = $bpc->TopDir(); my $beenThere = {}; -my $dsn = "dbi:SQLite:dbname=$TopDir/$Conf{SearchDB}"; -my $user = ''; - -# DEBUG option! -($dsn,$user) = qw/dbi:Pg:dbname=backuppc dpavlin/; +my $dsn = $Conf{SearchDSN} || die "Need SearchDSN in config.pl\n"; +my $user = $Conf{SearchUser} || ''; my $dbh = DBI->connect($dsn, $user, "", { RaiseError => 1, AutoCommit => 0 }); @@ -156,7 +155,7 @@ } print " done...\n"; - eval { $dbh->commit; }; + $dbh->commit; } if ($opt{v}) { @@ -279,6 +278,8 @@ $dbh->commit(); $dbh->disconnect(); +print "total duration: ",fmt_time(time() - $start_t),"\n"; + $pidfile->remove; sub getShareID() {