From 5e4c7ce2129d093fb7a3f6415691814ea2bae36c 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 Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- 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 0a4ab9b32f..84db2b9210 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 @@ -528,6 +530,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.39.5