Lines 25-36
cancel_expired_holds.pl - cron script to cancel holds as they expire
Link Here
|
25 |
=head1 SYNOPSIS |
25 |
=head1 SYNOPSIS |
26 |
|
26 |
|
27 |
./cancel_expired_holds.pl |
27 |
./cancel_expired_holds.pl |
28 |
./cancel_expired_holds.pl --reason="EXPIRED" |
28 |
./cancel_expired_holds.pl --reason="EXPIRED" --notify |
29 |
|
29 |
|
30 |
or, in crontab: |
30 |
or, in crontab: |
31 |
|
31 |
|
32 |
0 1 * * * cancel_expired_holds.pl |
32 |
0 1 * * * cancel_expired_holds.pl |
33 |
0 1 * * * cancel_expired_holds.pl --reason="EXPIRED" |
33 |
0 1 * * * cancel_expired_holds.pl --reason="EXPIRED" --notify |
34 |
|
34 |
|
35 |
=head1 DESCRIPTION |
35 |
=head1 DESCRIPTION |
36 |
|
36 |
|
Lines 56-80
Print a brief help message and exits.
Link Here
|
56 |
|
56 |
|
57 |
=item B<--reason> |
57 |
=item B<--reason> |
58 |
|
58 |
|
59 |
Optionally adds a reason for cancellation (which will trigger a notice to be sent to the patron) |
59 |
Optionally adds a reason for cancellation |
|
|
60 |
|
61 |
=item B<--notify> |
62 |
|
63 |
Optionally trigger a notice to be sent to the patron |
60 |
|
64 |
|
61 |
=back |
65 |
=back |
62 |
|
66 |
|
63 |
=cut |
67 |
=cut |
64 |
|
68 |
|
65 |
my $help = 0; |
69 |
my $help = 0; |
|
|
70 |
my $notify = 0; |
66 |
my $reason; |
71 |
my $reason; |
67 |
|
72 |
|
68 |
my $command_line_options = join(" ",@ARGV); |
73 |
my $command_line_options = join(" ",@ARGV); |
69 |
|
74 |
|
70 |
GetOptions( |
75 |
GetOptions( |
71 |
'help|?' => \$help, |
76 |
'help|?' => \$help, |
72 |
'reason=s' => \$reason |
77 |
'notify' => \$notify, |
|
|
78 |
'reason=s' => \$reason, |
73 |
) or pod2usage(1); |
79 |
) or pod2usage(1); |
74 |
pod2usage(1) if $help; |
80 |
pod2usage(1) if $help; |
75 |
|
81 |
|
76 |
cronlogaction({ info => $command_line_options }); |
82 |
cronlogaction({ info => $command_line_options }); |
77 |
|
83 |
|
78 |
C4::Reserves::CancelExpiredReserves($reason); |
84 |
C4::Reserves::CancelExpiredReserves($reason, $notify); |
79 |
|
85 |
|
80 |
cronlogaction({ action => 'End', info => "COMPLETED" }); |
86 |
cronlogaction({ action => 'End', info => "COMPLETED" }); |
81 |
- |
|
|