From e68d2beaf0a2392d5d00e50a43a7154771f48a94 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 21 Jul 2022 12:44:40 +0000 Subject: [PATCH] Bug 31203: POC advance_notices This patch proposes a new standard for cronlogaction We copy @ARGV into a space separated string, then pass this to cronlogaction At the end of the script we add a call with info "COMPLETED" To test: 1 - Apply patch 2 - perl misc/cronjobs/advance_notices.pl -v -m 4 -n -c 3 - sudo koha-mysql kohadev 4 - SELECT * FROM action_logs WHERE interface="CRON"; 5 - Note start and completion logged 6 - Note command line arguments included in info If this looks good I will copy this pattern to the other cronjobs Signed-off-by: David Nind Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- misc/cronjobs/advance_notices.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl index 725fc13482..d27513017d 100755 --- a/misc/cronjobs/advance_notices.pl +++ b/misc/cronjobs/advance_notices.pl @@ -185,6 +185,8 @@ my $itemscontent = join(',',qw( date_due title author barcode )); my $help = 0; my $man = 0; +my $command_line_options = join(" ",@ARGV); + GetOptions( 'help|?' => \$help, 'man' => \$man, @@ -215,7 +217,7 @@ END_WARN unless ($confirm) { pod2usage(1); } -cronlogaction(); +cronlogaction({ info => $command_line_options }); my %branches = (); if (@branchcodes) { @@ -638,6 +640,7 @@ sub send_digests { } } +cronlogaction({ info => "COMPLETED" }); 1; -- 2.39.5