View | Details | Raw Unified | Return to bug 37495
Collapse All | Expand All

(-)a/misc/cronjobs/plugins_nightly.pl (-3 / +13 lines)
Lines 2-7 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Getopt::Long qw( GetOptions );
5
use Try::Tiny qw( catch try );
6
use Try::Tiny qw( catch try );
6
7
7
use C4::Context;
8
use C4::Context;
Lines 13-23 use Koha::Script -cron; Link Here
13
my $command_line_options = join(" ",@ARGV);
14
my $command_line_options = join(" ",@ARGV);
14
cronlogaction({ info => $command_line_options });
15
cronlogaction({ info => $command_line_options });
15
16
17
my $metadata;
18
GetOptions(
19
    'm|metadata=s%' => \$metadata,
20
);
21
16
my $logger = Koha::Logger->get();
22
my $logger = Koha::Logger->get();
17
if ( C4::Context->config("enable_plugins") ) {
23
if ( C4::Context->config("enable_plugins") ) {
18
    my @plugins = Koha::Plugins->new->GetPlugins(
24
    my @plugins = Koha::Plugins->new->GetPlugins(
19
        {
25
        {
20
            method => 'cronjob_nightly',
26
            method   => 'cronjob_nightly',
27
            metadata => $metadata,
21
        }
28
        }
22
    );
29
    );
23
30
Lines 44-50 plugins_nightly.pl - Run nightly tasks specified by plugins Link Here
44
51
45
=head1 SYNOPSIS
52
=head1 SYNOPSIS
46
53
47
plugins_nightly.pl
54
plugins_nightly.pl [-m|--metadata key=value]
55
56
-m --metadata, repeatable, specify a metadata key and value to run only plugins
57
                           with nightly_cronjob methods and matching metadata.
58
                           e.g. plugins_nightly.pl -m name="My Awesome Plugin"
48
59
49
=head1 AUTHOR
60
=head1 AUTHOR
50
61
51
- 

Return to bug 37495