View | Details | Raw Unified | Return to bug 25429
Collapse All | Expand All

(-)a/misc/cronjobs/cleanup_database.pl (-2 / +17 lines)
Lines 84-90 Usage: $0 [-h|--help] [--confirm] [--sessions] [--sessdays DAYS] [-v|--verbose] Link Here
84
                         days.  Defaults to 14 days if no days specified.
84
                         days.  Defaults to 14 days if no days specified.
85
   --restrictions DAYS   purge patrons restrictions expired since more than DAYS days.
85
   --restrictions DAYS   purge patrons restrictions expired since more than DAYS days.
86
                         Defaults to 30 days if no days specified.
86
                         Defaults to 30 days if no days specified.
87
    --all-restrictions   purge all expired patrons restrictions.
87
   --all-restrictions   purge all expired patrons restrictions.
88
   --return-claims DAYS Purge all resolved return claims older than DAYS
88
   --del-exp-selfreg  Delete expired self registration accounts
89
   --del-exp-selfreg  Delete expired self registration accounts
89
   --del-unv-selfreg  DAYS  Delete unverified self registrations older than DAYS
90
   --del-unv-selfreg  DAYS  Delete unverified self registrations older than DAYS
90
   --unique-holidays DAYS  Delete all unique holidays older than DAYS
91
   --unique-holidays DAYS  Delete all unique holidays older than DAYS
Lines 122-127 my $pZ3950; Link Here
122
my $pListShareInvites;
123
my $pListShareInvites;
123
my $pDebarments;
124
my $pDebarments;
124
my $allDebarments;
125
my $allDebarments;
126
my $return_claims;
125
my $pExpSelfReg;
127
my $pExpSelfReg;
126
my $pUnvSelfReg;
128
my $pUnvSelfReg;
127
my $fees_days;
129
my $fees_days;
Lines 155-160 GetOptions( Link Here
155
    'list-invites:i'    => \$pListShareInvites,
157
    'list-invites:i'    => \$pListShareInvites,
156
    'restrictions:i'    => \$pDebarments,
158
    'restrictions:i'    => \$pDebarments,
157
    'all-restrictions'  => \$allDebarments,
159
    'all-restrictions'  => \$allDebarments,
160
    'return-claims:i'   => \$return_claims,
158
    'del-exp-selfreg'   => \$pExpSelfReg,
161
    'del-exp-selfreg'   => \$pExpSelfReg,
159
    'del-unv-selfreg'   => \$pUnvSelfReg,
162
    'del-unv-selfreg'   => \$pUnvSelfReg,
160
    'unique-holidays:i' => \$special_holidays_days,
163
    'unique-holidays:i' => \$special_holidays_days,
Lines 214-219 unless ( $sessions Link Here
214
    || defined $pPseudoTransactions
217
    || defined $pPseudoTransactions
215
    || $pPseudoTransactionsFrom
218
    || $pPseudoTransactionsFrom
216
    || $pPseudoTransactionsTo
219
    || $pPseudoTransactionsTo
220
    || $return_claims
217
) {
221
) {
218
    print "You did not specify any cleanup work for the script to do.\n\n";
222
    print "You did not specify any cleanup work for the script to do.\n\n";
219
    usage(1);
223
    usage(1);
Lines 484-489 if ($pStatistics) { Link Here
484
    }
488
    }
485
}
489
}
486
490
491
if ($return_claims) {
492
    print "Purging return claims older than $return_claims days.\n" if $verbose;
493
    $sth = $dbh->prepare(
494
        q{
495
            DELETE FROM return_claims
496
            WHERE resolved_on < DATE_SUB(CURDATE(), INTERVAL ? DAY)
497
        }
498
    );
499
    $sth->execute($return_claims);
500
    print "Done with purging return claims.\n" if $verbose;
501
}
502
487
if ($pDeletedCatalog) {
503
if ($pDeletedCatalog) {
488
    print "Purging deleted catalog older than $pDeletedCatalog days.\n"
504
    print "Purging deleted catalog older than $pDeletedCatalog days.\n"
489
      if $verbose;
505
      if $verbose;
490
- 

Return to bug 25429