From 4455244a9b7999a7f77bf2c2fcb334694facb765 Mon Sep 17 00:00:00 2001
From: Katrin Fischer <katrin.fischer.83@web.de>
Date: Tue, 15 Nov 2022 16:54:47 +0000
Subject: [PATCH] Bug 32093: Make help and code match for bg-days in
 cleanup_database.pl

There as a mismatch between the parameter name in documentation (bg-days)
and what was checked in the code (bg-jobs). This makes both match.

To test:
* Apply patch
* Make sure you have some background_jobs older than one day
* Verify the help of the script documents the parameter bg-days
* Run the cleanup_database.pl job
  Example:  ./misc/cronjobs/cleanup_database.pl --bg-days  --confirm -v
* Verify there are no errors and the lines have been deleted as expected

Signed-off-by: David Nind <david@davidnind.com>
---
 misc/cronjobs/cleanup_database.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl
index aff16f987b..96783c159f 100755
--- a/misc/cronjobs/cleanup_database.pl
+++ b/misc/cronjobs/cleanup_database.pl
@@ -52,7 +52,7 @@ use Koha::Patron::Debarments qw( DelDebarment );
 
 sub usage {
     print STDERR <<USAGE;
-Usage: $0 [-h|--help] [--confirm] [--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] [--old-issues DAYS] [--old-reserves DAYS] [--transfers DAYS] [--labels DAYS] [--cards DAYS] [--bg-jobs DAYS [--bg-type TYPE] ]
+Usage: $0 [-h|--help] [--confirm] [--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] [--old-issues DAYS] [--old-reserves DAYS] [--transfers DAYS] [--labels DAYS] [--cards DAYS] [--bg-days DAYS [--bg-type TYPE] ]
 
    -h --help          prints this help message, and exits, ignoring all
                       other options
@@ -199,7 +199,7 @@ GetOptions(
     'cards'             => \$cards,
     'return-claims'     => \$return_claims,
     'bg-type:s'        => \@background_types,
-    'bg-jobs:i'         => \$background_days,
+    'bg-days:i'         => \$background_days,
 ) || usage(1);
 
 # Use default values
-- 
2.30.2