Lines 44-50
use Koha::UploadedFiles;
Link Here
|
44 |
|
44 |
|
45 |
sub usage { |
45 |
sub usage { |
46 |
print STDERR <<USAGE; |
46 |
print STDERR <<USAGE; |
47 |
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] |
47 |
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] |
48 |
|
48 |
|
49 |
-h --help prints this help message, and exits, ignoring all |
49 |
-h --help prints this help message, and exits, ignoring all |
50 |
other options |
50 |
other options |
Lines 87-92
Usage: $0 [-h|--help] [--sessions] [--sessdays DAYS] [-v|--verbose] [--zebraqueu
Link Here
|
87 |
--statistics DAYS Purge entries from statistics older than DAYS days. |
87 |
--statistics DAYS Purge entries from statistics older than DAYS days. |
88 |
--deleted-catalog DAYS Purge deleted catalog older than DAYS |
88 |
--deleted-catalog DAYS Purge deleted catalog older than DAYS |
89 |
in tables deleteditems, deletedbiblioitems, deletedbiblio_metadata and deletedbiblio |
89 |
in tables deleteditems, deletedbiblioitems, deletedbiblio_metadata and deletedbiblio |
|
|
90 |
--deleted-patrons DAYS Purge deleted patrons older than DAYS days. |
90 |
USAGE |
91 |
USAGE |
91 |
exit $_[0]; |
92 |
exit $_[0]; |
92 |
} |
93 |
} |
Lines 114-119
my $temp_uploads_days;
Link Here
|
114 |
my $uploads_missing; |
115 |
my $uploads_missing; |
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 139-144
GetOptions(
Link Here
|
139 |
'uploads-missing:i' => \$uploads_missing, |
141 |
'uploads-missing:i' => \$uploads_missing, |
140 |
'statistics:i' => \$pStatistics, |
142 |
'statistics:i' => \$pStatistics, |
141 |
'deleted-catalog:i' => \$pDeletedCatalog, |
143 |
'deleted-catalog:i' => \$pDeletedCatalog, |
|
|
144 |
'deleted-patrons:i' => \$pDeletedPatrons, |
142 |
) || usage(1); |
145 |
) || usage(1); |
143 |
|
146 |
|
144 |
# Use default values |
147 |
# Use default values |
Lines 174-179
unless ( $sessions
Link Here
|
174 |
|| defined $uploads_missing |
177 |
|| defined $uploads_missing |
175 |
|| $pStatistics |
178 |
|| $pStatistics |
176 |
|| $pDeletedCatalog |
179 |
|| $pDeletedCatalog |
|
|
180 |
|| $pDeletedPatrons |
177 |
) { |
181 |
) { |
178 |
print "You did not specify any cleanup work for the script to do.\n\n"; |
182 |
print "You did not specify any cleanup work for the script to do.\n\n"; |
179 |
usage(1); |
183 |
usage(1); |
Lines 384-389
if ($pDeletedCatalog) {
Link Here
|
384 |
print "Done with purging deleted catalog.\n" if $verbose; |
388 |
print "Done with purging deleted catalog.\n" if $verbose; |
385 |
} |
389 |
} |
386 |
|
390 |
|
|
|
391 |
if ($pDeletedPatrons) { |
392 |
print "Purging deleted patrons older than $pDeletedPatrons days.\n" if $verbose; |
393 |
$sth = $dbh->prepare( |
394 |
q{ |
395 |
DELETE FROM deletedborrowers |
396 |
WHERE updated_on < DATE_SUB(CURDATE(), INTERVAL ? DAY) |
397 |
} |
398 |
); |
399 |
$sth->execute($pDeletedPatrons); |
400 |
print "Done with purging deleted patrons.\n" if $verbose; |
401 |
} |
402 |
|
387 |
exit(0); |
403 |
exit(0); |
388 |
|
404 |
|
389 |
sub RemoveOldSessions { |
405 |
sub RemoveOldSessions { |
390 |
- |
|
|