From f64b33da26a08f00915c97ed6d2f26fa2cac5914 Mon Sep 17 00:00:00 2001 From: Manvi Date: Wed, 21 Jan 2026 02:29:38 +0000 Subject: [PATCH] Bug 36067: Use '--confirm' across commandline scripts This patch changes commandline scripts using --commit to use --confirm instead, to be more consistent. --- debian/docs/koha-elasticsearch.xml | 4 ++-- debian/scripts/koha-elasticsearch | 6 +++--- misc/cronjobs/crontab.example | 2 +- misc/cronjobs/delete_items.pl | 10 +++++----- misc/cronjobs/longoverdue.pl | 2 +- misc/cronjobs/patron_emailer.pl | 2 +- misc/link_bibs_to_authorities.pl | 4 ++-- misc/search_tools/rebuild_elasticsearch.pl | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/debian/docs/koha-elasticsearch.xml b/debian/docs/koha-elasticsearch.xml index a0b5f2e442..8f41aa7225 100644 --- a/debian/docs/koha-elasticsearch.xml +++ b/debian/docs/koha-elasticsearch.xml @@ -35,7 +35,7 @@ -b|--biblios -a|--authorities -w|--where - -c n|--commit n + -c n|--confirm n -v|--verbose instancename @@ -89,7 +89,7 @@ - + Specifies how many records will be batched up before they are added to Elasticsearch (default: 5000). Higher values lead to better performance, but take more RAM. diff --git a/debian/scripts/koha-elasticsearch b/debian/scripts/koha-elasticsearch index e9a0a1ba10..c517cdc956 100755 --- a/debian/scripts/koha-elasticsearch +++ b/debian/scripts/koha-elasticsearch @@ -42,7 +42,7 @@ Options: --reset|-r Reset elasticsearch mappings from file. --authorities|-a Only run process for authorities. --biblios|-b Only run process for biblios. - -c|--commit n Specify how many records will be batched up before + -c|--confirm n Specify how many records will be batched up before they're added to Elasticsearch (default: 5000). -p|--processes n Specify the number of parallel processes to use for indexing. @@ -90,7 +90,7 @@ run_rebuild_elasticsearch() if [ "${clo_commit_size}" -gt 0 ] 2>/dev/null; then commit_size=${clo_commit_size} fi - rebuild_opts="--commit ${commit_size}" + rebuild_opts="--confirm ${commit_size}" if [ "${clo_processes}" -gt 0 ] 2>/dev/null; then processes=${clo_processes} @@ -160,7 +160,7 @@ while [ -n "$*" ]; do -a|--authorities) toggle_authorities_only ;; - -c|--commit) + -c|--confirm) clo_commit_size="$2" ; shift ;; -p|--processes) diff --git a/misc/cronjobs/crontab.example b/misc/cronjobs/crontab.example index 4d609cf081..4a1ca5d7af 100644 --- a/misc/cronjobs/crontab.example +++ b/misc/cronjobs/crontab.example @@ -79,7 +79,7 @@ KOHA_CRON_PATH = /usr/share/koha/bin/cronjobs 0 1 * * * __KOHA_USER__ $KOHA_CRON_PATH/holds/auto_unsuspend_holds.pl > /dev/null 2>&1 # Update popularity counts for biblio records -0 2 * * * __KOHA_USER__ $KOHA_CRON_PATH/update_totalissues.pl --commit=1000 --use-stats --incremental --interval=1d >/dev/null 2>&1 +0 2 * * * __KOHA_USER__ $KOHA_CRON_PATH/update_totalissues.pl --confirm=1000 --use-stats --incremental --interval=1d >/dev/null 2>&1 # ZEBRA INDEX UPDATES with -z option, incremental index updates throughout the day # for both authorities and bibs diff --git a/misc/cronjobs/delete_items.pl b/misc/cronjobs/delete_items.pl index 0b5a737517..36fd9933fa 100755 --- a/misc/cronjobs/delete_items.pl +++ b/misc/cronjobs/delete_items.pl @@ -92,7 +92,7 @@ delete_items.pl - A batch item deletion tool, which generates a query against th delete_items.pl [--help|--manual] -delete_items.pl [--verbose] --where "I" ... [--commit] +delete_items.pl [--verbose] --where "I" ... [--confirm] =cut @@ -119,9 +119,9 @@ The C<--where> option may called multiple times. The following argument must be a syntactically valid SQL statement which is part of the C clause querying the items table. These are joined by C. -=item B<--commit> +=item B<--confirm> -No items will be deleted unless the C<--commit> flag is present. +No items will be deleted unless the C<--confirm> flag is present. =item B<--del_bibs> @@ -135,9 +135,9 @@ Deletes the bibliographic record if the last item is deleted. The following is an example of this script: - delete_items.pl --where "withdrawn ! 0" --where "withdrawn_on < $(date --date="13 month ago" --rfc-3339=date)" --commit + delete_items.pl --where "withdrawn ! 0" --where "withdrawn_on < $(date --date="13 month ago" --rfc-3339=date)" --confirm - delete_items.pl --where "itemlost >= '1'" --where "itemlost <='4'" --where "itemlost_on < '2014-04-28'" --commit + delete_items.pl --where "itemlost >= '1'" --where "itemlost <='4'" --where "itemlost_on < '2014-04-28'" --confirm =cut diff --git a/misc/cronjobs/longoverdue.pl b/misc/cronjobs/longoverdue.pl index 5657588b62..d2d8993d92 100755 --- a/misc/cronjobs/longoverdue.pl +++ b/misc/cronjobs/longoverdue.pl @@ -135,7 +135,7 @@ if ($list_itemtypes) { [ --skip-category BORROWER_CATEGORY ] ... [ --library LIBRARY_CODE ] [ --skip-library LIBRARY_CODE ] ... [ --skip-lost-value LOST_VALUE [ --skip-lost-value LOST_VALUE ] ] - [ --commit ] + [ --confirm ] WARNING: Flippant use of this script could set all or most of the items in your catalog to Lost and charge your diff --git a/misc/cronjobs/patron_emailer.pl b/misc/cronjobs/patron_emailer.pl index dd2da26187..a3fbcf0edb 100755 --- a/misc/cronjobs/patron_emailer.pl +++ b/misc/cronjobs/patron_emailer.pl @@ -43,7 +43,7 @@ patron_emailer.pl --from specified email for 'from' address, report column 'from' used if not specified --email specified column to use as 'to' email address, report column 'email' used if not specified --verbose increased verbosity, will print notices and errors - --commit send emails, without this script will only report + --confirm send emails, without this script will only report =head1 OPTIONS diff --git a/misc/link_bibs_to_authorities.pl b/misc/link_bibs_to_authorities.pl index c9d5aa308c..bb5c7d0d7c 100755 --- a/misc/link_bibs_to_authorities.pl +++ b/misc/link_bibs_to_authorities.pl @@ -290,7 +290,7 @@ link_bibs_to_authorities.pl link_bibs_to_authorities.pl link_bibs_to_authorities.pl -v link_bibs_to_authorities.pl -l - link_bibs_to_authorities.pl --commit=1000 + link_bibs_to_authorities.pl --confirm=1000 link_bibs_to_authorities.pl --auth-limit=STRING link_bibs_to_authorities.pl --bib-limit=STRING link_bibs_to_authorities.pl -g=700 @@ -325,7 +325,7 @@ user-specified WHERE clause. Only process those bib records that match the user-specified WHERE clause. -=item B<--commit=N> +=item B<--confirm=N> Commit the results to the database after every N records are processed. diff --git a/misc/search_tools/rebuild_elasticsearch.pl b/misc/search_tools/rebuild_elasticsearch.pl index 406e5ed700..6df54b31df 100755 --- a/misc/search_tools/rebuild_elasticsearch.pl +++ b/misc/search_tools/rebuild_elasticsearch.pl @@ -26,7 +26,7 @@ rebuild_elasticsearch.pl - inserts records from a Koha database into Elasticsear =head1 SYNOPSIS B -[B<-c|--commit>=C] +[B<-c|--confirm>=C] [B<-d|--delete>] [B<-r|--reset>] [B<-a|--authorities>] @@ -48,7 +48,7 @@ Inserts records from a Koha database into Elasticsearch. =over -=item B<-c|--commit>=C +=item B<-c|--confirm>=C Specify how many records will be batched up before they're added to Elasticsearch. Higher should be faster, but will cause more RAM usage. Default is 5000. -- 2.39.5