19 |
my $connect = "DBI:Pg:dbname=backuppc"; |
my $connect = "DBI:Pg:dbname=backuppc"; |
20 |
|
|
21 |
my $commit_every = 100; |
my $commit_every = 100; |
22 |
|
my $limit = 0; # no limit |
23 |
|
#$limit = 1000; |
24 |
|
|
25 |
my $bar = Term::ProgressBar->new({ |
my $bar = Term::ProgressBar->new({ |
26 |
count => 100, |
count => 1000, |
27 |
# fh => \*STDOUT, |
# fh => \*STDOUT, |
28 |
# name => 'thingy', |
# name => 'thingy', |
29 |
ETA => 'linear', |
ETA => 'linear', |
84 |
and files.backupnum = backups.num |
and files.backupnum = backups.num |
85 |
and shares.id = backups.shareid |
and shares.id = backups.shareid |
86 |
order by backups.date |
order by backups.date |
|
limit 1000 |
|
87 |
}; |
}; |
88 |
|
|
89 |
|
$sql .= qq{ limit $limit } if ($limit); |
90 |
|
|
91 |
_debug("prepare"); |
_debug("prepare"); |
92 |
my $sth = $dbh->prepare($sql) || die $dbh->errstr(); |
my $sth = $dbh->prepare($sql) || die $dbh->errstr(); |
93 |
_debug("execute"); |
_debug("execute"); |