Bug 27050: Allow multiple category_codes in delete_patrons.pl
[koha.git] / misc / cronjobs / plugins_nightly.pl
1 #!/usr/bin/perl
2
3 use Modern::Perl;
4
5 use Koha::Logger;
6 use Koha::Script -cron;
7
8 cronlogaction();
9
10 my $logger = Koha::Logger->get();
11 if ( C4::Context->config("enable_plugins") ) {
12     my @plugins = Koha::Plugins->new->GetPlugins(
13         {
14             method => 'cronjob_nightly',
15         }
16     );
17
18     foreach my $plugin (@plugins) {
19         try {
20             $plugin->cronjob_nightly();
21         }
22         catch {
23             warn "$_";
24             $logger->warn("$_");
25         };
26     }
27 }
28
29 =head1 NAME
30
31 plugins_nightly.pl - Run nightly tasks specified by plugins
32
33 =head1 SYNOPSIS
34
35 plugins_nightly.pl
36
37 =head1 AUTHOR
38
39 Martin Renvoize <martin.renvoize@ptfs-europe.com>
40
41 =head1 LICENSE
42
43 This file is part of Koha.
44
45 Koha is free software; you can redistribute it and/or modify it
46 under the terms of the GNU General Public License as published by
47 the Free Software Foundation; either version 3 of the License, or
48 (at your option) any later version.
49
50 Koha is distributed in the hope that it will be useful, but
51 WITHOUT ANY WARRANTY; without even the implied warranty of
52 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
53 GNU General Public License for more details.
54
55 You should have received a copy of the GNU General Public License
56 along with Koha; if not, see <http://www.gnu.org/licenses>.
57
58 =cut