From d58b5ed6a331ad4b204dd08e19694662d4374ee5 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 13 May 2021 09:28:36 -0400 Subject: [PATCH] Bug 25429: Require command line switch to enable, control DAYS via syspref --- misc/cronjobs/cleanup_database.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl index 376dc3711a..8cdafe9dd2 100755 --- a/misc/cronjobs/cleanup_database.pl +++ b/misc/cronjobs/cleanup_database.pl @@ -109,7 +109,8 @@ Usage: $0 [-h|--help] [--confirm] [--sessions] [--sessdays DAYS] [-v|--verbose] --pseudo-transactions-from YYYY-MM-DD and/or --pseudo-transactions-to YYYY-MM-DD --labels DAYS Purge item label batches last added to more than DAYS days ago. --cards DAY Purge card creator batches last added to more than DAYS days ago. - + --return-claims Purge all resolved return claims older than the number of days specified in + the system preference CleanUpDatabaseReturnClaims. USAGE exit $_[0]; } @@ -129,7 +130,7 @@ my $pZ3950; my $pListShareInvites; my $pDebarments; my $allDebarments; -my $return_claims = C4::Context->preference('CleanUpDatabaseReturnClaims'); +my $return_claims; my $pExpSelfReg; my $pUnvSelfReg; my $fees_days; @@ -186,6 +187,7 @@ GetOptions( 'pseudo-transactions-to:s' => \$pPseudoTransactionsTo, 'labels' => \$labels, 'cards' => \$cards, + 'return-claims' => \$return_claims, ) || usage(1); # Use default values @@ -530,6 +532,7 @@ if ($pStatistics) { } } +$return_claims = C4::Context->preference('CleanUpDatabaseReturnClaims') if $return_claims; if ($return_claims) { print "Purging return claims older than $return_claims days.\n" if $verbose; -- 2.24.3 (Apple Git-128)