From b6b9dac46799fc81a4dbce406e30579b2cd3cf63 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 and the PID 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 --- 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 9ec07659aa..2d9f47b11a 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({ pid => $$ , info => $command_line_options }); my %branches = (); if (@branchcodes) { @@ -635,6 +637,7 @@ sub send_digests { } } +cronlogaction({ pid => $$ , info => "COMPLETED" }); 1; -- 2.30.2