@@ -, +, @@ --- Koha/Cron.pm | 16 ++++++++++++++++ misc/cronjobs/advance_notices.pl | 5 +---- .../automatic_item_modification_by_age.pl | 6 +----- misc/cronjobs/automatic_renewals.pl | 6 +----- misc/cronjobs/batch_anonymise.pl | 5 +---- misc/cronjobs/build_browser_and_cloud.pl | 5 +---- misc/cronjobs/cart_to_shelf.pl | 5 +---- misc/cronjobs/check-url-quick.pl | 7 ++----- misc/cronjobs/check-url.pl | 2 ++ misc/cronjobs/cleanup_database.pl | 5 +---- misc/cronjobs/cloud-kw.pl | 6 ++---- misc/cronjobs/create_koc_db.pl | 7 ++----- .../delete_expired_opac_registrations.pl | 1 + misc/cronjobs/delete_items.pl | 7 ++----- misc/cronjobs/delete_patrons.pl | 5 +---- misc/cronjobs/delete_records_via_leader.pl | 6 +----- misc/cronjobs/edi_cron.pl | 6 +----- misc/cronjobs/fines.pl | 5 +---- misc/cronjobs/gather_print_notices.pl | 5 +---- misc/cronjobs/import_webservice_batch.pl | 5 +---- misc/cronjobs/j2a.pl | 5 +---- misc/cronjobs/longoverdue.pl | 6 ++---- misc/cronjobs/membership_expiry.pl | 5 +---- misc/cronjobs/merge_authorities.pl | 5 +---- misc/cronjobs/notice_unprocessed_suggestions.pl | 6 +----- misc/cronjobs/overdue_notices.pl | 6 +----- misc/cronjobs/process_message_queue.pl | 6 ++---- misc/cronjobs/purge_suggestions.pl | 6 ++---- misc/cronjobs/reconcile_balances.pl | 5 +---- misc/cronjobs/remove_temporary_edifiles.pl | 1 + misc/cronjobs/runreport.pl | 5 +---- misc/cronjobs/serialsUpdate.pl | 5 +---- misc/cronjobs/share_usage_with_koha_community.pl | 5 +---- misc/cronjobs/sitemap.pl | 2 ++ misc/cronjobs/staticfines.pl | 5 +---- misc/cronjobs/stockrotation.pl | 7 ++----- misc/cronjobs/update_totalissues.pl | 6 ++---- 37 files changed, 63 insertions(+), 138 deletions(-) create mode 100644 Koha/Cron.pm --- a/Koha/Cron.pm +++ a/Koha/Cron.pm @@ -0,0 +1,16 @@ +package Koha::Cron; + +use strict; +use warnings; +use utf8; +use feature ':5.10'; + +use C4::Context; + +C4::Context->_new_userenv(1); +C4::Context->set_userenv( + '-1', '-1', undef, 'CRON', 'CRON', undef, + undef, undef, undef, undef, undef +); + +1; --- a/misc/cronjobs/advance_notices.pl +++ a/misc/cronjobs/advance_notices.pl @@ -49,6 +49,7 @@ BEGIN { use FindBin; eval { require "$FindBin::Bin/../kohalib.pl" }; } +use Koha::Cron; use C4::Biblio; use C4::Context; use C4::Letters; @@ -223,10 +224,6 @@ END_WARN unless ($confirm) { pod2usage(1); } -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); # The fields that will be substituted into <> --- a/misc/cronjobs/automatic_item_modification_by_age.pl +++ a/misc/cronjobs/automatic_item_modification_by_age.pl @@ -6,6 +6,7 @@ use Getopt::Long; use Pod::Usage; use JSON; +use Koha::Cron; use C4::Context; use C4::Items; @@ -20,11 +21,6 @@ my $result = GetOptions( pod2usage(1) if $help; $verbose = 1 unless $confirm; -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); - # Load configuration from the syspref my $syspref_content = C4::Context->preference('automatic_item_modification_by_age_configuration'); my $rules = eval { JSON::from_json( $syspref_content ) }; --- a/misc/cronjobs/automatic_renewals.pl +++ a/misc/cronjobs/automatic_renewals.pl @@ -52,6 +52,7 @@ use Modern::Perl; use Pod::Usage; use Getopt::Long; +use Koha::Cron; use C4::Circulation; use C4::Context; use C4::Log; @@ -67,11 +68,6 @@ GetOptions( ) || pod2usage(1); pod2usage(0) if $help; - -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); my $auto_renews = Koha::Checkouts->search({ auto_renew => 1 }); --- a/misc/cronjobs/batch_anonymise.pl +++ a/misc/cronjobs/batch_anonymise.pl @@ -29,6 +29,7 @@ BEGIN { eval { require "$FindBin::Bin/../kohalib.pl" }; } +use Koha::Cron; use C4::Context; use Koha::Patrons; use Date::Calc qw( @@ -67,10 +68,6 @@ if ( !$days ) { usage(1); } -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); my ($year,$month,$day) = Today(); --- a/misc/cronjobs/build_browser_and_cloud.pl +++ a/misc/cronjobs/build_browser_and_cloud.pl @@ -10,6 +10,7 @@ BEGIN { eval { require "$FindBin::Bin/../kohalib.pl" }; } +use Koha::Cron; use C4::Koha; use C4::Context; use C4::Biblio; @@ -62,10 +63,6 @@ my $browser_subfield = $2; warn "browser : $browser_tag / $browser_subfield" unless $batch; die "no cloud or browser field/subfield defined : nothing to do !" unless $browser_tag or $cloud_tag; -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); my $dbh = C4::Context->dbh; --- a/misc/cronjobs/cart_to_shelf.pl +++ a/misc/cronjobs/cart_to_shelf.pl @@ -28,6 +28,7 @@ cart_to_shelf.pl cron script to set items with location of CART to original she use strict; use warnings; +use Koha::Cron; use C4::Items qw/ CartToShelf /; use C4::Log; @@ -64,10 +65,6 @@ unless ($hours) { die "ERROR: No --hours (-h) option defined"; } -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); my $query = "SELECT itemnumber FROM items WHERE location = 'CART' AND TIMESTAMPDIFF(HOUR, items.timestamp, NOW() ) > ?"; --- a/misc/cronjobs/check-url-quick.pl +++ a/misc/cronjobs/check-url-quick.pl @@ -20,6 +20,8 @@ use Modern::Perl; use Pod::Usage; use Getopt::Long; + +use Koha::Cron; use C4::Context; use C4::Biblio; use AnyEvent; @@ -43,11 +45,6 @@ GetOptions( 'tags=s{,}' => \@tags, ); -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); - # Validate tags to check { my %h = map { $_ => undef } @tags; --- a/misc/cronjobs/check-url.pl +++ a/misc/cronjobs/check-url.pl @@ -78,6 +78,7 @@ use strict; use warnings; use LWP::UserAgent; use HTTP::Request; +use Koha::Cron; use C4::Biblio; @@ -147,6 +148,7 @@ use Carp; use Pod::Usage; use Getopt::Long; +use Koha::Cron; use C4::Context; --- a/misc/cronjobs/cleanup_database.pl +++ a/misc/cronjobs/cleanup_database.pl @@ -34,6 +34,7 @@ BEGIN { eval { require "$FindBin::Bin/../kohalib.pl" }; } +use Koha::Cron; use C4::Context; use C4::Search; use C4::Search::History; @@ -176,10 +177,6 @@ if ($pDebarments && $allDebarments) { usage(1); } -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); my $dbh = C4::Context->dbh(); --- a/misc/cronjobs/cloud-kw.pl +++ a/misc/cronjobs/cloud-kw.pl @@ -25,6 +25,8 @@ use Carp; use YAML::Syck; use Pod::Usage; use Getopt::Long; + +use Koha::Cron; use C4::Context; use C4::Log; @@ -44,10 +46,6 @@ sub usage { usage() if $help || !$conf; -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); my @clouds; --- a/misc/cronjobs/create_koc_db.pl +++ a/misc/cronjobs/create_koc_db.pl @@ -94,6 +94,8 @@ $|++; use DBI; use Getopt::Long; use Pod::Usage; + +use Koha::Cron; use C4::Context; use English qw(-no_match_vars); @@ -118,11 +120,6 @@ GetOptions( pod2usage(1) if $help; pod2usage( -verbose => 2 ) if $man; -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); - my %wanted_borrowers_columns = map { $_ => 1 } qw/borrowernumber cardnumber surname firstname address city phone dateofbirth/; my %wanted_issues_columns = map { $_ => 1 } qw/borrowernumber date_due itemcallnumber title itemtype/; --- a/misc/cronjobs/delete_expired_opac_registrations.pl +++ a/misc/cronjobs/delete_expired_opac_registrations.pl @@ -28,6 +28,7 @@ BEGIN { eval { my $lib = "$FindBin::Bin/../kohalib.pl"; require $lib }; } +use Koha::Cron; use C4::Context; my $help; --- a/misc/cronjobs/delete_items.pl +++ a/misc/cronjobs/delete_items.pl @@ -1,17 +1,14 @@ #! /usr/bin/perl use Getopt::Long; + +use Koha::Cron; use C4::Context; use C4::Items; use C4::Circulation; use Modern::Perl; use Pod::Usage; -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); - my $dbh = C4::Context->dbh(); my $query = { --- a/misc/cronjobs/delete_patrons.pl +++ a/misc/cronjobs/delete_patrons.pl @@ -5,6 +5,7 @@ use Modern::Perl; use Pod::Usage; use Getopt::Long; +use Koha::Cron; use C4::Members; use Koha::DateUtils; use Koha::Patrons; @@ -41,10 +42,6 @@ unless ( $not_borrowed_since or $expired_before or $last_seen or $category_code pod2usage(q{At least one filter is mandatory}); } -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); my $members = GetBorrowersToExpunge( --- a/misc/cronjobs/delete_records_via_leader.pl +++ a/misc/cronjobs/delete_records_via_leader.pl @@ -33,6 +33,7 @@ BEGIN { use Getopt::Long; use Pod::Usage; +use Koha::Cron; use C4::Biblio; use C4::Items; use Koha::Database; @@ -77,11 +78,6 @@ This script has the following parameters : exit(); } -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); - my @metadatas = # Should be replaced by a call to C4::Search on zebra index # Record-status when bug 15537 will be pushed Koha::Biblio::Metadatas->search( { format => 'marcxml', schema => C4::Context->preference('marcflavour'), metadata => { LIKE => '%_____d%' } } ); --- a/misc/cronjobs/edi_cron.pl +++ a/misc/cronjobs/edi_cron.pl @@ -29,6 +29,7 @@ use utf8; # can be run as frequently as required # log messages are appended to logdir/editrace.log +use Koha::Cron; use C4::Context; use Log::Log4perl qw(:easy); use Koha::Database; @@ -36,11 +37,6 @@ use Koha::EDI qw( process_quote process_invoice process_ordrsp); use Koha::Edifact::Transport; use Fcntl qw( :DEFAULT :flock :seek ); -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); - my $logdir = C4::Context->config('logdir'); # logging set to trace as this may be what you --- a/misc/cronjobs/fines.pl +++ a/misc/cronjobs/fines.pl @@ -30,6 +30,7 @@ use strict; use warnings; use 5.010; +use Koha::Cron; use C4::Context; use C4::Overdues; use Getopt::Long; @@ -71,10 +72,6 @@ if ($help) { exit; } -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); my @borrower_fields = --- a/misc/cronjobs/gather_print_notices.pl +++ a/misc/cronjobs/gather_print_notices.pl @@ -10,6 +10,7 @@ BEGIN { } use CGI qw( utf8 ); # NOT a CGI script, this is just to keep C4::Templates::gettemplate happy +use Koha::Cron; use C4::Context; use C4::Debug; use C4::Letters; @@ -79,10 +80,6 @@ if ( $ods and @letter_codes != 1 ) { $delimiter ||= q|,|; -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); my $today_iso = output_pref( { dt => dt_from_string, dateonly => 1, dateformat => 'iso' } ) ; --- a/misc/cronjobs/import_webservice_batch.pl +++ a/misc/cronjobs/import_webservice_batch.pl @@ -31,6 +31,7 @@ BEGIN { use Getopt::Long; use Pod::Usage; +use Koha::Cron; use C4::ImportBatch; my ($help, $framework); @@ -50,10 +51,6 @@ EOF ; exit; } -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); my $batch_ids = GetStagedWebserviceBatches() or exit; --- a/misc/cronjobs/j2a.pl +++ a/misc/cronjobs/j2a.pl @@ -26,6 +26,7 @@ BEGIN { eval { require "$FindBin::Bin/../kohalib.pl" }; } +use Koha::Cron; use C4::Context; use C4::Members; use Getopt::Long; @@ -125,10 +126,6 @@ if ( not $fromcat && $tocat ) { #make sure we've specified the info we need. exit; } -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); my $dbh = C4::Context->dbh; --- a/misc/cronjobs/longoverdue.pl +++ a/misc/cronjobs/longoverdue.pl @@ -33,6 +33,8 @@ BEGIN { use FindBin; eval { require "$FindBin::Bin/../kohalib.pl" }; } + +use Koha::Cron; use C4::Context; use C4::Items; use C4::Circulation qw/LostItem MarkIssueReturned/; @@ -228,10 +230,6 @@ unless ($confirm) { print "### TEST MODE -- NO ACTIONS TAKEN ###\n"; } -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); # In my opinion, this line is safe SQL to have outside the API. --atz --- a/misc/cronjobs/membership_expiry.pl +++ a/misc/cronjobs/membership_expiry.pl @@ -126,6 +126,7 @@ BEGIN { eval { require "$FindBin::Bin/../kohalib.pl" }; } +use Koha::Cron; use C4::Context; use C4::Letters; use C4::Log; @@ -157,10 +158,6 @@ GetOptions( pod2usage( -verbose => 2 ) if $man; pod2usage(1) if $help || !$confirm; -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); my $expdays = C4::Context->preference('MembershipExpiryDaysNotice'); --- a/misc/cronjobs/merge_authorities.pl +++ a/misc/cronjobs/merge_authorities.pl @@ -5,6 +5,7 @@ use Getopt::Long; use Pod::Usage; use Time::HiRes qw(gettimeofday); +use Koha::Cron; use C4::AuthoritiesMarc; use Koha::Authority::MergeRequests; @@ -20,10 +21,6 @@ GetOptions( $|=1; # flushes output if ( $params->{batch} ) { - C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef - ); handle_batch($params); } else { --- a/misc/cronjobs/notice_unprocessed_suggestions.pl +++ a/misc/cronjobs/notice_unprocessed_suggestions.pl @@ -5,6 +5,7 @@ use Modern::Perl; use Pod::Usage; use Getopt::Long; +use Koha::Cron; use C4::Budgets qw( GetBudget ); use C4::Suggestions qw( GetUnprocessedSuggestions ); use Koha::Libraries; @@ -22,11 +23,6 @@ if ($help) { pod2usage( verbose => 2 ); } -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); - unless (@days) { pod2usage(q{At least one day parameter should be given}); exit; --- a/misc/cronjobs/overdue_notices.pl +++ a/misc/cronjobs/overdue_notices.pl @@ -34,6 +34,7 @@ use Text::CSV_XS; use DateTime; use DateTime::Duration; +use Koha::Cron; use C4::Context; use C4::Letters; use C4::Overdues qw(GetFine GetOverdueMessageTransportTypes parse_overdues_letter); @@ -325,11 +326,6 @@ GetOptions( ) or pod2usage(2); pod2usage(1) if $help; pod2usage( -verbose => 2 ) if $man; - -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction() unless $test_mode; if ( defined $csvfilename && $csvfilename =~ /^-/ ) { --- a/misc/cronjobs/process_message_queue.pl +++ a/misc/cronjobs/process_message_queue.pl @@ -25,6 +25,8 @@ BEGIN { use FindBin; eval { require "$FindBin::Bin/../kohalib.pl" }; } + +use Koha::Cron; use C4::Letters; use C4::Log; use Getopt::Long; @@ -66,10 +68,6 @@ ENDUSAGE die $usage if $help; -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); C4::Letters::SendQueuedMessages( --- a/misc/cronjobs/purge_suggestions.pl +++ a/misc/cronjobs/purge_suggestions.pl @@ -28,6 +28,8 @@ BEGIN { use Getopt::Long; use Pod::Usage; + +use Koha::Cron; use C4::Suggestions; use C4::Log; use C4::Context; @@ -63,10 +65,6 @@ if( !$confirm || $help || !defined($days) ) { print "No confirm parameter passed!\n\n" if !$confirm && !$help; print $usage; } elsif( $days and $days > 0 ) { - C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef - ); cronlogaction( " ( days: $days )"); DelSuggestionsOlderThan($days); } else { --- a/misc/cronjobs/reconcile_balances.pl +++ a/misc/cronjobs/reconcile_balances.pl @@ -62,6 +62,7 @@ BEGIN { eval { require "$FindBin::Bin/../kohalib.pl" }; } +use Koha::Cron; use C4::Log; use Koha::Account::Lines; @@ -76,10 +77,6 @@ GetOptions( ) or pod2usage(2); pod2usage(1) if $help; -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); my @patron_ids = map { $_->borrowernumber } Koha::Account::Lines->search( --- a/misc/cronjobs/remove_temporary_edifiles.pl +++ a/misc/cronjobs/remove_temporary_edifiles.pl @@ -2,6 +2,7 @@ use strict; use warnings; +use Koha::Cron; use C4::Context; # this script will remove those older than 5 days --- a/misc/cronjobs/runreport.pl +++ a/misc/cronjobs/runreport.pl @@ -20,6 +20,7 @@ use Modern::Perl; +use Koha::Cron; use C4::Reports::Guided; # 0.12 use Koha::Reports; use C4::Context; @@ -204,10 +205,6 @@ pod2usage( -verbose => 2 ) if ($man); pod2usage( -verbose => 2 ) if ($help and $verbose); pod2usage(1) if $help; -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); unless ($format) { --- a/misc/cronjobs/serialsUpdate.pl +++ a/misc/cronjobs/serialsUpdate.pl @@ -28,6 +28,7 @@ BEGIN { eval { require "$FindBin::Bin/../kohalib.pl" }; } +use Koha::Cron; use C4::Context; use C4::Debug; use C4::Serials; @@ -79,10 +80,6 @@ GetOptions( pod2usage(1) if $help; pod2usage( -verbose => 2 ) if $man; -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); $verbose and !$confirm and print "### Database will not be modified ###\n"; --- a/misc/cronjobs/share_usage_with_koha_community.pl +++ a/misc/cronjobs/share_usage_with_koha_community.pl @@ -5,6 +5,7 @@ use Modern::Perl; use Pod::Usage; use Getopt::Long; +use Koha::Cron; use C4::Context; use C4::UsageStats; use C4::Log; @@ -35,10 +36,6 @@ Setting the quiet flag will silence this message. exit 1; } -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); my $need_update = ($force ? 1 : C4::UsageStats::NeedUpdate() ); --- a/misc/cronjobs/sitemap.pl +++ a/misc/cronjobs/sitemap.pl @@ -23,6 +23,8 @@ use Modern::Perl; use utf8; use Pod::Usage; use Getopt::Long; + +use Koha::Cron; use C4::Biblio; use Koha::Sitemapper; --- a/misc/cronjobs/staticfines.pl +++ a/misc/cronjobs/staticfines.pl @@ -37,6 +37,7 @@ BEGIN { use Date::Calc qw/Date_to_Days/; +use Koha::Cron; use C4::Context; use C4::Circulation; use C4::Overdues; @@ -91,10 +92,6 @@ This script has the following parameters : ENDUSAGE die $usage if $help; -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); my $dbh = C4::Context->dbh; --- a/misc/cronjobs/stockrotation.pl +++ a/misc/cronjobs/stockrotation.pl @@ -109,15 +109,12 @@ database updates have been performed."). use Modern::Perl; use Getopt::Long qw/HelpMessage :config gnu_getopt/; + +use Koha::Cron; use C4::Context; use C4::Letters; use Koha::StockRotationRotas; -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); - my $admin_email = ''; my $branch = 0; my $execute = 0; --- a/misc/cronjobs/update_totalissues.pl +++ a/misc/cronjobs/update_totalissues.pl @@ -30,6 +30,8 @@ BEGIN { use Getopt::Long; use Pod::Usage; + +use Koha::Cron; use C4::Context; use C4::Biblio; use C4::Log; @@ -95,10 +97,6 @@ if ( not $result or $want_help ) { usage(); } -C4::Context->set_userenv( - '-1', '-1', undef, 'CRON', 'CRON', undef, - undef, undef, undef, undef, undef -); cronlogaction(); my $dbh = C4::Context->dbh; --