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 ) { |
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 |
|
|
155 |
} |
} |
156 |
print " done...\n"; |
print " done...\n"; |
157 |
|
|
158 |
eval { $dbh->commit; }; |
$dbh->commit; |
159 |
} |
} |
160 |
|
|
161 |
if ($opt{v}) { |
if ($opt{v}) { |
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() { |