|
Lines 75-81
Usage: $0 [-h|--help] [--sessions] [--sessdays DAYS] [-v|--verbose] [--zebraqueu
Link Here
|
| 75 |
days. Defaults to 14 days if no days specified. |
75 |
days. Defaults to 14 days if no days specified. |
| 76 |
--restrictions DAYS purge patrons restrictions expired since more than DAYS days. |
76 |
--restrictions DAYS purge patrons restrictions expired since more than DAYS days. |
| 77 |
Defaults to 30 days if no days specified. |
77 |
Defaults to 30 days if no days specified. |
| 78 |
--all-restrictions purge all expired patrons restrictions. |
78 |
--all-restrictions purge all expired patrons restrictions. |
|
|
79 |
--return-claims DAYS Purge all resolved return claims older than DAYS |
| 79 |
--del-exp-selfreg Delete expired self registration accounts |
80 |
--del-exp-selfreg Delete expired self registration accounts |
| 80 |
--del-unv-selfreg DAYS Delete unverified self registrations older than DAYS |
81 |
--del-unv-selfreg DAYS Delete unverified self registrations older than DAYS |
| 81 |
--unique-holidays DAYS Delete all unique holidays older than DAYS |
82 |
--unique-holidays DAYS Delete all unique holidays older than DAYS |
|
Lines 108-113
my $pZ3950;
Link Here
|
| 108 |
my $pListShareInvites; |
109 |
my $pListShareInvites; |
| 109 |
my $pDebarments; |
110 |
my $pDebarments; |
| 110 |
my $allDebarments; |
111 |
my $allDebarments; |
|
|
112 |
my $return_claims; |
| 111 |
my $pExpSelfReg; |
113 |
my $pExpSelfReg; |
| 112 |
my $pUnvSelfReg; |
114 |
my $pUnvSelfReg; |
| 113 |
my $fees_days; |
115 |
my $fees_days; |
|
Lines 139-144
GetOptions(
Link Here
|
| 139 |
'list-invites:i' => \$pListShareInvites, |
141 |
'list-invites:i' => \$pListShareInvites, |
| 140 |
'restrictions:i' => \$pDebarments, |
142 |
'restrictions:i' => \$pDebarments, |
| 141 |
'all-restrictions' => \$allDebarments, |
143 |
'all-restrictions' => \$allDebarments, |
|
|
144 |
'return-claims:i' => \$return_claims, |
| 142 |
'del-exp-selfreg' => \$pExpSelfReg, |
145 |
'del-exp-selfreg' => \$pExpSelfReg, |
| 143 |
'del-unv-selfreg' => \$pUnvSelfReg, |
146 |
'del-unv-selfreg' => \$pUnvSelfReg, |
| 144 |
'unique-holidays:i' => \$special_holidays_days, |
147 |
'unique-holidays:i' => \$special_holidays_days, |
|
Lines 192-197
unless ( $sessions
Link Here
|
| 192 |
|| $pOldIssues |
195 |
|| $pOldIssues |
| 193 |
|| $pOldReserves |
196 |
|| $pOldReserves |
| 194 |
|| $pTransfers |
197 |
|| $pTransfers |
|
|
198 |
|| $return_claims |
| 195 |
) { |
199 |
) { |
| 196 |
print "You did not specify any cleanup work for the script to do.\n\n"; |
200 |
print "You did not specify any cleanup work for the script to do.\n\n"; |
| 197 |
usage(1); |
201 |
usage(1); |
|
Lines 405-410
if ($pStatistics) {
Link Here
|
| 405 |
print "Done with purging statistics.\n" if $verbose; |
409 |
print "Done with purging statistics.\n" if $verbose; |
| 406 |
} |
410 |
} |
| 407 |
|
411 |
|
|
|
412 |
if ($return_claims) { |
| 413 |
print "Purging return claims older than $return_claims days.\n" if $verbose; |
| 414 |
$sth = $dbh->prepare( |
| 415 |
q{ |
| 416 |
DELETE FROM return_claims |
| 417 |
WHERE resolved_on < DATE_SUB(CURDATE(), INTERVAL ? DAY) |
| 418 |
} |
| 419 |
); |
| 420 |
$sth->execute($return_claims); |
| 421 |
print "Done with purging return claims.\n" if $verbose; |
| 422 |
} |
| 423 |
|
| 408 |
if ($pDeletedCatalog) { |
424 |
if ($pDeletedCatalog) { |
| 409 |
print "Purging deleted catalog older than $pDeletedCatalog days.\n" if $verbose; |
425 |
print "Purging deleted catalog older than $pDeletedCatalog days.\n" if $verbose; |
| 410 |
my $sth1 = $dbh->prepare( |
426 |
my $sth1 = $dbh->prepare( |
| 411 |
- |
|
|