Lines 45-51
use Koha::UploadedFiles;
Link Here
|
45 |
|
45 |
|
46 |
sub usage { |
46 |
sub usage { |
47 |
print STDERR <<USAGE; |
47 |
print STDERR <<USAGE; |
48 |
Usage: $0 [-h|--help] [--sessions] [--sessdays DAYS] [-v|--verbose] [--zebraqueue DAYS] [-m|--mail] [--merged] [--import DAYS] [--logs DAYS] [--searchhistory DAYS] [--restrictions DAYS] [--all-restrictions] [--fees DAYS] [--temp-uploads] [--temp-uploads-days DAYS] [--uploads-missing 0|1 ] [--statistics DAYS] [--deleted-catalog DAYS] |
48 |
Usage: $0 [-h|--help] [--sessions] [--sessdays DAYS] [-v|--verbose] [--zebraqueue DAYS] [-m|--mail] [--merged] [--import DAYS] [--logs DAYS] [--searchhistory DAYS] [--restrictions DAYS] [--all-restrictions] [--fees DAYS] [--temp-uploads] [--temp-uploads-days DAYS] [--uploads-missing 0|1 ] [--statistics DAYS] [--deleted-catalog DAYS] [--deleted-patrons DAYS] |
49 |
|
49 |
|
50 |
-h --help prints this help message, and exits, ignoring all |
50 |
-h --help prints this help message, and exits, ignoring all |
51 |
other options |
51 |
other options |
Lines 86-91
Usage: $0 [-h|--help] [--sessions] [--sessdays DAYS] [-v|--verbose] [--zebraqueu
Link Here
|
86 |
--statistics DAYS Purge entries from statistics older than DAYS days. |
86 |
--statistics DAYS Purge entries from statistics older than DAYS days. |
87 |
--deleted-catalog DAYS Purge deleted catalog older than DAYS |
87 |
--deleted-catalog DAYS Purge deleted catalog older than DAYS |
88 |
in tables deleteditems, deletedbiblioitems, deletedbiblio_metadata and deletedbiblio |
88 |
in tables deleteditems, deletedbiblioitems, deletedbiblio_metadata and deletedbiblio |
|
|
89 |
--deleted-patrons DAYS Purge deleted patrons older than DAYS days. |
89 |
USAGE |
90 |
USAGE |
90 |
exit $_[0]; |
91 |
exit $_[0]; |
91 |
} |
92 |
} |
Lines 114-119
my $uploads_missing;
Link Here
|
114 |
my $oauth_tokens; |
115 |
my $oauth_tokens; |
115 |
my $pStatistics; |
116 |
my $pStatistics; |
116 |
my $pDeletedCatalog; |
117 |
my $pDeletedCatalog; |
|
|
118 |
my $pDeletedPatrons; |
117 |
|
119 |
|
118 |
GetOptions( |
120 |
GetOptions( |
119 |
'h|help' => \$help, |
121 |
'h|help' => \$help, |
Lines 140-145
GetOptions(
Link Here
|
140 |
'oauth-tokens' => \$oauth_tokens, |
142 |
'oauth-tokens' => \$oauth_tokens, |
141 |
'statistics:i' => \$pStatistics, |
143 |
'statistics:i' => \$pStatistics, |
142 |
'deleted-catalog:i' => \$pDeletedCatalog, |
144 |
'deleted-catalog:i' => \$pDeletedCatalog, |
|
|
145 |
'deleted-patrons:i' => \$pDeletedPatrons, |
143 |
) || usage(1); |
146 |
) || usage(1); |
144 |
|
147 |
|
145 |
# Use default values |
148 |
# Use default values |
Lines 176-181
unless ( $sessions
Link Here
|
176 |
|| $oauth_tokens |
179 |
|| $oauth_tokens |
177 |
|| $pStatistics |
180 |
|| $pStatistics |
178 |
|| $pDeletedCatalog |
181 |
|| $pDeletedCatalog |
|
|
182 |
|| $pDeletedPatrons |
179 |
) { |
183 |
) { |
180 |
print "You did not specify any cleanup work for the script to do.\n\n"; |
184 |
print "You did not specify any cleanup work for the script to do.\n\n"; |
181 |
usage(1); |
185 |
usage(1); |
Lines 401-406
if ($pDeletedCatalog) {
Link Here
|
401 |
print "Done with purging deleted catalog.\n" if $verbose; |
405 |
print "Done with purging deleted catalog.\n" if $verbose; |
402 |
} |
406 |
} |
403 |
|
407 |
|
|
|
408 |
if ($pDeletedPatrons) { |
409 |
print "Purging deleted patrons older than $pDeletedPatrons days.\n" if $verbose; |
410 |
$sth = $dbh->prepare( |
411 |
q{ |
412 |
DELETE FROM deletedborrowers |
413 |
WHERE updated_on < DATE_SUB(CURDATE(), INTERVAL ? DAY) |
414 |
} |
415 |
); |
416 |
$sth->execute($pDeletedPatrons); |
417 |
print "Done with purging deleted patrons.\n" if $verbose; |
418 |
} |
419 |
|
404 |
exit(0); |
420 |
exit(0); |
405 |
|
421 |
|
406 |
sub RemoveOldSessions { |
422 |
sub RemoveOldSessions { |
407 |
- |
|
|