Bug 20393: Remove redundant 'koha.psgi' and 'plackup.sh' files
[koha.git] / misc / mod_zebraqueue.pl
blob32fcc31d9112c1122e946fea214a61484342a36c
1 #!/usr/bin/perl
3 # Copyright 2012 Kyle M Hall
4 # This file is part of Koha.
6 # Koha is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # Koha is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Koha; if not, see <http://www.gnu.org/licenses>.
19 # script to add records to the zebraqueue from the commandline.
21 use Modern::Perl;
23 use Getopt::Long;
24 use Pod::Usage;
26 use C4::Biblio;
28 my @biblios;
29 my @authorities;
30 my $help;
31 my $verbose;
33 GetOptions(
34 "b|biblio|biblionumber=s" => \@biblios,
35 "a|authority|authoritynumber=s" => \@authorities,
36 'h|?|help' => \$help,
37 'v|verbose' => \$verbose,
40 pod2usage( -exitval => 0 ) if ( $help || !( @biblios || @authorities ) );
42 foreach my $biblionumber (@biblios) {
43 print "Adding bibliographic record $biblionumber to Zebra queue\n" if ($verbose);
44 ModZebra( $biblionumber, "specialUpdate", "biblioserver" );
47 foreach my $authority (@authorities) {
48 print "Adding authority record $authority to Zebra queue\n" if ($verbose);
49 ModZebra( $authority, 'specialUpdate', "authorityserver" );
52 __END__
54 =head1 NAME
56 mod_zebraqueue.pl - Mark bibliographic and/or authority records for updating via the zebraqueue.
58 =head1 SYNOPSIS
60 mod_zebraqueue.pl -v -b $bib1 -b $bib2 -a $authority1 -a $authority2
62 =head1 OPTIONS
64 =over 8
66 =item B<-b, --biblio, --biblionumber>
68 The biblionumber of a record to be updated, repeatable.
70 =item B<-a, --authority, --authoritynumber>
72 The authoritynumber of the record to be updated, repeatable.
74 =item B<-h, -?, --help>
76 Prints this help message and exits.
78 =item B<-v, --verbose>
80 Be verbose
82 =back
84 =cut