From 9959b83ac2592cca1058f649301b0365983e5392 Mon Sep 17 00:00:00 2001 From: Andrew Fuerste-Henry Date: Wed, 10 Mar 2021 17:59:53 +0000 Subject: [PATCH] Bug 15563: add option to cleanup_database to delete old label and card batches To test: For item label batches: 1- Create 3 item label batches of at least 2 items each 2- Perform the following updates via the database 3- In Batch 1, set all items' timestamps to 10+ days prior to today 4- In Batch 2, set 1 item's timestamp to 10+ days prior to today 5- In Batch 3, do not update any timestamps 6- Run cron with --labels 9 7- Confirm batch 1 is deleted, batches 2 and 3 are not Repeat with card creator batches 8- Create 3 card creator batches of at least 2 items each 9- Perform the following updates via the database 10- In Batch 1, set all cards' timestamps to 10+ days prior to today 11- In Batch 2, set 1 card's timestamp to 10+ days prior to today 12- In Batch 3, do not update any timestamps 13- Run cron with --cards 9 14- Confirm batch 1 is deleted, batches 2 and 3 are not https://bugs.koha-community.org/show_bug.cgi?id=15569 --- misc/cronjobs/cleanup_database.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl index a4d7e0ce70..f17c88d756 100755 --- a/misc/cronjobs/cleanup_database.pl +++ b/misc/cronjobs/cleanup_database.pl @@ -107,6 +107,8 @@ Usage: $0 [-h|--help] [--confirm] [--sessions] [--sessdays DAYS] [-v|--verbose] --pseudo-transactions DAYS Purge the pseudonymized transactions that have been originally created more than DAYS days ago DAYS is optional and can be replaced by: --pseudo-transactions-from YYYY-MM-DD and/or --pseudo-transactions-to YYYY-MM-DD + --cards DAYS Purge patron card creator batches last added to more than DAYS days ago. + --labels DAYS Purge label creator batches last added to more than DAYS days ago. USAGE exit $_[0]; } -- 2.11.0