5 use Try::Tiny qw( catch try );
8 use C4::Log qw( cronlogaction );
11 use Koha::Script -cron;
13 my $command_line_options = join(" ",@ARGV);
14 cronlogaction({ info => $command_line_options });
16 my $logger = Koha::Logger->get();
17 if ( C4::Context->config("enable_plugins") ) {
18 my @plugins = Koha::Plugins->new->GetPlugins(
20 method => 'cronjob_nightly',
24 foreach my $plugin (@plugins) {
25 my $plugin_name = ref $plugin;
27 cronlogaction({ info => "running nightly cronjob for plugin $plugin_name" });
28 $plugin->cronjob_nightly();
29 cronlogaction({ info => "finished nightly cronjob for plugin $plugin_name" });
32 cronlogaction({ info => "failed to running nightly cronjob for plugin $plugin_name with error: $_" });
39 cronlogaction({ action => 'End', info => "COMPLETED" });
43 plugins_nightly.pl - Run nightly tasks specified by plugins
51 Martin Renvoize <martin.renvoize@ptfs-europe.com>
55 This file is part of Koha.
57 Koha is free software; you can redistribute it and/or modify it
58 under the terms of the GNU General Public License as published by
59 the Free Software Foundation; either version 3 of the License, or
60 (at your option) any later version.
62 Koha is distributed in the hope that it will be useful, but
63 WITHOUT ANY WARRANTY; without even the implied warranty of
64 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
65 GNU General Public License for more details.
67 You should have received a copy of the GNU General Public License
68 along with Koha; if not, see <http://www.gnu.org/licenses>.