1 .. include:: images.rst
7 A cron job is a Linux command for scheduling a command or script on your
8 server to complete repetitive tasks automatically. Scripts executed as a
9 cron job are typically used to modify files or databases; however, they
10 can perform other tasks that do not modify data on the server, like
11 sending out email notifications. Koha has many cron jobs in place that
12 you can enable (search engine indexing, overdue notice generation, data
13 cleanup and more), this chapter will explain those for you.
15 .. _cron-jobs-subchapter-label:
18 -------------------------
20 The locations below assume a dev install which puts the crons in misc/,
21 if you have a standard install you may want to look in bin/ for these
22 files if you cannot find them in misc/
27 ~~~~~~~~~~~~~~~~~~~~~~~~
29 .. _rebuild-index-label:
32 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34 Script path: misc/migration\_tools/rebuild\_zebra.pl
36 Does: Updates Zebra indexes with recently changed data.
40 Frequency suggestion: every x minutes, (between 5-15 minutes) depending
43 .. _circulation-label:
46 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
48 .. _holds-queue-label:
51 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53 Script path: misc/cronjobs/holds/build\_holds\_queue.pl
55 Does: Updates holds queue report
57 Required by: :ref:`Holds Queue Report <holds-queue-label>`
59 Frequency suggestion: every 1-4 hours
63 - A script that should be run periodically if your library system
64 allows borrowers to place on-shelf holds. This script decides which
65 library should be responsible for fulfilling a given hold request.
67 It's behavior is controlled by the system preferences
68 :ref:`StaticHoldsQueueWeight <staticholdsqueueweight,-holdsqueueskipclosed-&-randomizeholdsqueueweight-label>` and
69 :ref:`RandomizeHoldsQueueWeight <staticholdsqueueweight,-holdsqueueskipclosed-&-randomizeholdsqueueweight-label>`.
71 If you do not want all of your libraries to participate in the
72 on-shelf holds fulfillment process, you should list the the libraries
73 that \*do\* participate in the process here by inputting all the
74 participating library's branchcodes, separated by commas ( e.g.
75 "MPL,CPL,SPL,BML" etc. ).
77 By default, the holds queue will be generated such that the system
78 will first attempt to hold fulfillment using items already at the
79 pickup library if possible. If there are no items available at the
80 pickup library to fill a hold, build\_holds\_queue.pl will then use
81 the list of libraries defined in StaticHoldsQueueWeight. If
82 RandomizeHoldsQueueWeight is disabled ( which it is by default ), the
83 script will assign fulfillment requests in the order the branches are
84 placed in the StaticHoldsQueueWeight system preference.
86 For example, if your system has three libraries, of varying sizes (
87 small, medium and large ) and you want the burden of holds
88 fulfillment to be on larger libraries before smaller libraries, you
89 would want StaticHoldsQueueWeight to look something like
92 If you want the burden of holds fulfillment to be spread out equally
93 throughout your library system, simply enable
94 RandomizeHoldsQueueWeight. When this system preference is enabled,
95 the order in which libraries will be requested to fulfill an on-shelf
96 hold will be randomized each time the list is regenerated.
98 Leaving StaticHoldsQueueWeight empty is contraindicated at this time.
99 Doing so will cause the build\_holds\_queue script to ignore
100 RandomizeHoldsQueueWeight, causing the script to request hold
101 fulfillment not randomly, but by alphabetical order.
103 .. _perl-documentation-holds-queue-label:
106 ''''''''''''''''''''''''''''''''''''''''''''
108 **GetBibsWithPendingHoldRequests**
110 my $biblionumber\_aref = GetBibsWithPendingHoldRequests();
112 Return an arrayref of the biblionumbers of all bibs that have one or
113 more unfilled hold requests.
115 **GetPendingHoldRequestsForBib**
117 my $requests = GetPendingHoldRequestsForBib($biblionumber);
119 Returns an arrayref of hashrefs to pending, unfilled hold requests on
121 the bib identified by $biblionumber. The following keys are present in
140 The arrayref is sorted in order of increasing priority.
142 **GetItemsAvailableToFillHoldRequestsForBib**
144 my $available\_items =
146 GetItemsAvailableToFillHoldRequestsForBib($biblionumber);
148 Returns an arrayref of items available to fill hold requests for the bib
149 identified by $biblionumber. An item is available to fill a hold
151 request if and only if:
155 - it is not withdrawn
157 - it is not marked notforloan
159 - it is not currently in transit
163 - it is not sitting on the hold shelf
165 **MapItemsToHoldRequests**
167 MapItemsToHoldRequests($hold\_requests, $available\_items);
169 **CreatePickListFromItemMap**
171 **AddToHoldTargetMap**
173 **\_get\_branches\_to\_pull\_from**
175 Query system preferences to get ordered list of branches to use to fill
178 .. _expired-holds-label:
181 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
183 Script path: misc/cronjobs/holds/cancel\_expired\_holds.pl
185 Does: By default, this cron job will only automatically cancel holds
186 where the user has set an expiration date. If the library is using the
187 :ref:`ExpireReservesMaxPickUpDelay` and
188 :ref:`ExpireReservesMaxPickUpDelayCharge`
189 preferences then this script will also cancel holds that have been
190 sitting on the hold shelf for too long and will (if the library does)
191 charge the patron for not picking up the hold.
193 Frequency suggestion: daily
195 .. _unsuspend-holds-label:
198 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
200 Script path: misc/cronjobs/holds/auto\_unsuspend\_holds.pl
202 Does: This script checks to find holds that should no longer be
203 suspended and removes the suspension if the
204 :ref:`AutoResumeSuspendedHolds` preference is
205 set to 'allow'. This puts the patron back in to the queue where they
206 were when the hold was suspended.
208 Frequency suggestion: daily
213 ^^^^^^^^^^^^^^^^^^^^^^^^^
215 Script path: misc/cronjobs/fines.pl
217 Does: Calculates and posts fines to patron accounts.
219 Required by: :ref:`finesMode` system preference
221 Frequency suggestion: nightly
223 .. _long-overdues-label:
226 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
228 Script path: misc/cronjobs/longoverdue.pl
230 Does: allows one to specify delays for changing items to different lost
231 statuses, and optionally charge for them using the replacement price
232 listed on the item record.
234 Frequency suggestion: nightly
238 Staff can control some of the parameters for the longoverdue cron
240 :ref:`DefaultLongOverdueLostValue <defaultlongoverduelostvalue-&-defaultlongoverduedays-label>` and
241 :ref:`DefaultLongOverdueChargeValue`
244 .. _perl-documentation-long-overdues-label:
247 '''''''''''''''''''''''''''''''''''''''''''''
251 longoverdue.pl cron script to set lost statuses on overdue materials.
252 Execute without options for help.
258 This option takes the form of n=lv, where n is num days overdue, and lv
259 is the lost value. See warning below.
263 This specifies what lost value triggers Koha to charge the account for
264 the lost item. Replacement costs are not charged if this is not
273 confirm. without this option, the script will report the number of
274 affected items and return without modifying any records.
278 suppress summary output.
282 Specifies the end of the range of overdue days to deal with (defaults to
283 366). This value is universal to all lost num days overdue passed.
287 When an item is marked lost, remove it from the borrowers issued items.
289 .. _track-total-checkouts-label:
291 Track total checkouts
292 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
294 Script path: misc/cronjobs/update\_totalissues.pl
296 Does: updates the biblioitems.totalissues field in the database with the
297 latest tally of checkouts.
299 Frequency suggestion: nightly
301 .. _perl-documentation-track-total-checkouts-label:
304 '''''''''''''''''''''''''''''''''''''''''''''
308 update\_totalissues.pl
312 update\_totalissues.pl --use-stats
314 update\_totalissues.pl --use-items
316 update\_totalissues.pl --commit=1000
318 update\_totalissues.pl --since='2012-01-01'
320 update\_totalissues.pl --interval=30d
324 This batch job populates bibliographic records' total issues count based
325 on historical issue statistics.
327 --help Prints this help
331 Provide verbose log information (list every bib modified).
335 Use the data in the statistics table for populating total issues.
339 Use items.issues data for populating total issues. Note that issues data
340 from the items table does not respect the --since or --interval options,
341 by definition. Also note that if both --use-stats and --use-items are
342 specified, the count of biblios processed will be misleading.
346 Only process issues recorded in the statistics table since DATE.
350 Only process issues recorded in the statistics table in the last N units
351 of time. The interval should consist of a number with a one- letter unit
352 suffix. The valid suffixes are h (hours), d (days), w (weeks), m
353 (months), and y (years). The default unit is days.
357 Add the number of issues found in the statistics table to the existing
358 total issues count. Intended so that this script can be used as a cron
359 job to update popularity information during low-usage periods. If
360 neither --since or --interval are specified, incremental mode will
361 default to processing the last twenty-four hours.
365 Commit the results to the database after every N records are processed.
369 Only test the popularity population script.
373 If the time on your database server does not match the time on your Koha
374 server you will need to take that into account, and probably use the
375 --since argument instead of the --interval argument for incremental
380 This patch to Koha was sponsored by the Arcadia Public Library and the
381 Arcadia Public Library Foundation in honor of Jackie Faust-Moreno, late
382 director of the Arcadia Public Library.
386 Jared Camins-Esakov <jcamins AT cpbibliography DOT com>
388 .. _generate-patron-file-for-offline-circulation-label:
390 Generate Patron File for Offline Circulation
391 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
393 Script path: misc/cronjobs/create\_koc\_db.pl
395 Does: Generates the borrowers.db file for use with the :ref:`Koha Offline
396 Circulation <offline-circ-tool-for-windows-label>` tool
398 Frequency suggestion: weekly
400 .. _automatic-renewal-label:
403 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
405 Script path: misc/cronjobs/automatic\_renewals.pl
407 Does: Will automatically renew items if you're allowing automatic
408 renewal with your :ref:`circulation and fine rules <circulation-and-fine-rules-label>`.
410 Frequency suggestion: nightly
412 .. _perl-documentation-automatic-renewal-label:
415 '''''''''''''''''''''''''''''''''''''''''''
419 automatic\_renewals.pl - cron script to renew loans
423 ./automatic\_renewals.pl
425 or, in crontab: 0 3 \* \* \* automatic\_renewals.pl
429 This script searches for issues scheduled for automatic renewal
430 (issues.auto\_renew). If there are still renews left (Renewals allowed)
431 and the renewal isn't premature (No Renewal before) the issue is
441 ~~~~~~~~~~~~~~~~~~~~~~~~~~
443 .. _unverified-registrations-label:
445 Unverified Registrations
446 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
448 Script path: misc/cronjobs/delete\_expired\_opac\_registrations.pl
450 Does: Deletes patron registrations that were submitted via the OPAC but
451 not reviewed by the library within the number of days entered in the
452 :ref:`PatronSelfRegistrationExpireTemporaryAccountsDelay`
455 Frequency suggestion: nightly
457 .. _unconfirmed-registrations-label:
459 Unconfirmed Registrations
460 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
462 Script path: misc/cronjobs/delete\_unverified\_opac\_registrations.pl
464 Does: Deletes patron self registrations that were submitted via the OPAC
465 but not confirmed via email within 24 hours. This is only necessary if
466 you are requiring patrons to confirm their registrations via email with
468 :ref:`PatronSelfRegistrationVerifyByEmail`
471 Frequency suggestion: hourly
473 .. _anonymize-patron-data-label:
475 Anonymize Patron Data
476 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
478 Script path: misc/cronjobs/batch\_anonymise.pl
480 Does: Used to anonymize patron data. This will remove borrowernumbers
481 from circulation history so that the stats are kept, but the patron
482 information is removed for privacy reasons.
484 .. _update-child-to-adult-patron-type-label:
486 Update Child to Adult Patron Type
487 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
489 Script path: misc/cronjobs/j2a.pl
491 Does: Convert juvenile/child patrons from juvenile patron category and
492 category code to corresponding adult patron category and category code
493 when they reach the upper age limit defined in the Patron Categories.
495 Frequency suggestion: nightly
497 .. _perl-documentation-update-child-to-adult-patron-type-label:
500 ''''''''''''''''''''''''''''''''''''
504 juv2adult.pl - convert juvenile/child patrons from juvenile patron
505 category and category code to corresponding adult patron category and
506 category code when they reach the upper age limit defined in the Patron
511 juv2adult.pl [ -b=<branchcode> -f=<categorycode> -t=<categorycode> ]
515 --help brief help message
517 --man full documentation
521 -n take no action, display only
523 -b <branchname> only deal with patrons from this library/branch
525 -f <categorycode> change patron category from this category
527 -t <categorycode> change patron category to this category
531 --help Print a brief help message and exits.
533 --man Prints the manual page and exits.
535 -v Verbose. Without this flag set, only fatal errors are reported.
537 -n No Action. With this flag set, script will report changes but not
538 actually execute them on the database.
540 -b changes patrons for one specific branch. Use the value in the
541 branches.branchcode table.
543 -f \*required\* defines the juvenile category to update. Expects the
544 code from categories.categorycode.
546 -t \*required\* defines the category juvenile patrons will be converted
547 to. Expects the code from categories.categorycode.
551 This script is designed to update patrons from juvenile to adult patron
552 types, remove the guarantor, and update their category codes
553 appropriately when they reach the upper age limit defined in the Patron
558 "juv2adult.pl" - Suggests that you read this help. :)
560 "juv2adult.pl" -b=<branchcode> -f=<categorycode> -t=<categorycode> -
561 Processes a single branch, and updates the patron categories from
564 "juv2adult.pl" -f=<categorycode> -t=<categorycode> -v -n - Processes all
565 branches, shows all messages, and reports the patrons who would be
566 affected. Takes no action on the database.
571 ~~~~~~~~~~~~~~~~~~~~~~~~~~
573 .. _message-queue-label:
576 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
578 Script path: misc/cronjobs/process\_message\_queue.pl
580 Does: processes the message queue to send the check out, check in and
581 hold filled emails and SMS message to users and sends outgoing emails to
583 :ref:`EnhancedMessagingPreferences` to be
586 Frequency suggestion: 1-4 hours
590 Item due and Advanced due notices are controlled by the
591 :ref:`advance\_notices cron <advanced-notice-label>`.
593 .. _advanced-notice-label:
596 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
598 Script path: misc/cronjobs/advance\_notices.pl
600 Does: prepares "pre-due" notices and "item due" notices for patrons who
601 request them prepares notices for patrons for items just due or coming
603 :ref:`EnhancedMessagingPreferences` to be
606 Frequency suggestion: nightly
610 This script does not actually send the notices. It queues them in
611 the :ref:`message queue <message-queue-label>` for later
613 .. _perl-documentation-advanced-notice-label:
616 '''''''''''''''''''''''''''''''''''''''''''
620 advance\_notices.pl - cron script to put item due reminders into message
625 ./advance\_notices.pl -c
627 or, in crontab: 0 1 \* \* \* advance\_notices.pl -c
631 This script prepares pre-due and item due reminders to be sent to
632 patrons. It queues them in the message queue, which is processed by the
633 process\_message\_queue.pl cronjob. The type and timing of the messages
634 can be configured by the patrons in their "My Alerts" tab in the OPAC.
640 .. _overdue-notice-label:
643 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
645 Script path: misc/cronjobs/overdue\_notices.pl
647 Does: prepares messages to alert patrons of overdue messages (both via
650 Frequency suggestion: nightly
654 This script does not actually send the notices. It queues them in
655 the :ref:`message queue <message-queue-label>` for later or generates the
656 HTML for later printing
658 .. _perl-documentation-overdue-notice-label:
661 '''''''''''''''''''''''''''''''''''''''''''''''
665 overdue\_notices.pl - prepare messages to be sent to patrons for overdue
670 overdue\_notices.pl [ -n ] [ -library <branchcode> ] [ -library
671 <branchcode>...] [ -max <number of days> ] [ -csv [ <filename> ] ]
672 [-itemscontent <field list> ]
676 -help brief help message
678 -man full documentation
680 -n No email will be sent
682 -max <days> maximum days overdue to deal with
684 -library <branchname> only deal with overdues from this library
685 (repeatable : several libraries can be given)
687 -csv <filename> populate CSV file
689 -html <filename> Output HTML to file
691 -itemscontent <list of fields> item information in templates
693 -borcat <categorycode> category code that must be included
695 -borcatout <categorycode> category code that must be excluded
699 -help Print a brief help message and exits.
701 -man Prints the manual page and exits.
703 -v Verbose. Without this flag set, only fatal errors are reported.
705 -n Do not send any email. Overdue notices that would have been sent to
706 the patrons or to the admin are printed to standard out. CSV data (if
707 the -csv flag is set) is written to standard out or to any csv filename
710 -max Items older than max days are assumed to be handled somewhere else,
711 probably the longoverdues.pl script. They are therefore ignored by this
712 program. No notices are sent for them, and they are not added to any CSV
713 files. Defaults to 90 to match longoverdues.pl.
717 select overdues for one specific library. Use the value in the
718 branches.branchcode table. This option can be repeated in order to
719 select overdues for a group of libraries.
721 -csv Produces CSV data. if -n (no mail) flag is set, then this CSV data
722 is sent to standard out or to a filename if provided. Otherwise, only
723 overdues that could not be emailed are sent in CSV format to the admin.
727 comma separated list of fields that get substituted into templates in
728 places of the <<items.content>> placeholder. This defaults to
729 issuedate,title,barcode,author
731 Other possible values come from fields in the biblios, items, and issues
734 -borcat Repetable field, that permit to select only few of patrons
739 Repetable field, permis to exclude some patrons categories.
743 This option causes a notice to be generated if and only if an item is
744 overdue by the number of days defined in a notice trigger.
746 By default, a notice is sent each time the script runs, which is
747 suitable for less frequent run cron script, but requires syncing notice
748 triggers with the cron schedule to ensure proper behavior. Add the
749 --triggered option for daily cron, at the risk of no notice being
750 generated if the cron fails to run on time.
754 Default items.content lists only those items that fall in the range of
755 the currently processing notice. Choose list-all to include all overdue
756 items in the list (limited by -max setting).
760 This script is designed to alert patrons and administrators of overdue
765 This script pays attention to the overdue notice configuration performed
766 in the "Overdue notice/status triggers" section of the "Tools" area of
767 the staff interface to Koha. There, you can choose which letter
768 templates are sent out after a configurable number of days to patrons of
769 each library. More information about the use of this section of Koha is
770 available in the Koha manual.
772 The templates used to craft the emails are defined in the "Tools:
773 Notices" section of the staff interface to Koha.
777 Typically, messages are prepared for each patron with overdue items.
778 Messages for whom there is no email address on file are collected and
779 sent as attachments in a single email to each library administrator, or
780 if that is not set, then to the email address in the
781 "KohaAdminEmailAddress" system preference.
783 These emails are staged in the outgoing message queue, as are messages
784 produced by other features of Koha. This message queue must be processed
785 regularly by the misc/cronjobs/process\_message\_queue.pl program.
787 In the event that the "-n" flag is passed to this program, no emails are
788 sent. Instead, messages are sent on standard output from this program.
789 They may be redirected to a file if desired.
793 Templates can contain variables enclosed in double angle brackets like
794 <<this>>. Those variables will be replaced with values specific to the
795 overdue items or relevant patron. Available variables are:
799 the name of the library
803 one line for each item, each line containing a tab separated list of
804 title, author, barcode, issuedate
808 any field from the borrowers table
812 any field from the branches table
816 The "-csv" command line option lets you specify a file to which overdues
817 data should be output in CSV format.
819 With the "-n" flag set, data about all overdues is written to the file.
820 Without that flag, only information about overdues that were unable to
821 be sent directly to the patrons will be written. In other words, this
822 CSV file replaces the data that is typically sent to the administrator
827 "overdue\_notices.pl" - In this most basic usage, with no command line
828 arguments, all libraries are processed individually, and notices are
829 prepared for all patrons with overdue items for whom we have email
830 addresses. Messages for those patrons for whom we have no email address
831 are sent in a single attachment to the library administrator's email
832 address, or to the address in the KohaAdminEmailAddress system
835 "overdue\_notices.pl -n -csv /tmp/overdues.csv" - sends no email and
836 populates /tmp/overdues.csv with information about all overdue items.
838 "overdue\_notices.pl -library MAIN max 14" - prepare notices of overdues
839 in the last 2 weeks for the MAIN library.
843 The misc/cronjobs/advance\_notices.pl program allows you to send
844 messages to patrons in advance of their items becoming due, or to alert
845 them of items that have just become due.
849 These methods are internal to the operation of overdue\_notices.pl.
853 parses the letter template, replacing the placeholders with data
854 specific to this patron, biblio, or item
858 letter - required hashref
860 borrowernumber - required integer
862 substitute - optional hashref of other key/value pairs that should be
863 substituted in the letter content
865 returns the "letter" hashref, with the content updated to reflect the
866 substituted keys and values.
868 prepare\_letter\_for\_printing
870 returns a string of text appropriate for printing in the event that an
871 overdue notice will not be sent to the patron's email address. Depending
872 on the desired output format, this may be a CSV string, or a
873 human-readable representation of the notice.
885 .. _print-hold-notices-label:
888 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
890 Script path: misc/cronjobs/gather\_print\_notices.pl
892 Does: looks through the message queue for hold notices that didn't go
893 through because the patron didn't have an email address and generates a
896 Frequency suggestion: nightly
898 .. _talking-tech-label:
901 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
903 To learn more about setting up this third party product view the
904 `Talking Tech Appendix <#talkingtechappendix>`__.
906 .. _sending-notices-file-label:
909 '''''''''''''''''''''''''''''''''''''''''''''''
911 Script path: misc/cronjobs/thirdparty/TalkingTech\_itiva\_outbound.pl
913 Does: Script to generate Spec C outbound notifications file for Talking
914 Tech i-tiva phone notification system.
917 :ref:`TalkingTechItivaPhoneNotification`
919 Frequency suggestion: nightly
921 :ref:`Perl Documentation`
926 TalkingTech\_itiva\_outbound.pl
928 TalkingTech\_itiva\_outbound.pl --type=OVERDUE -w 0 -w 2 -w 6
929 --output=/tmp/talkingtech/outbound.csv
931 TalkingTech\_itiva\_outbound.pl --type=RESERVE --type=PREOVERDUE
934 Script to generate Spec C outbound notifications file for Talking Tech
935 i-tiva phone notification system.
941 -v Provide verbose log information.
945 Destination for outbound notifications file (CSV format). If no value is
946 specified, output is dumped to screen.
950 Sets the language for all outbound messages. Currently supported values
951 are EN, FR and ES. If no value is specified, EN will be used by default.
955 REQUIRED. Sets which messaging types are to be used. Can be given
956 multiple times, to specify multiple types in a single output file.
957 Currently supported values are RESERVE, PREOVERDUE and OVERDUE. If no
958 value is given, this script will not produce any outbound notifications.
960 --waiting-hold-day -w
962 OPTIONAL for --type=RESERVE. Sets the days after a hold has been set to
963 waiting on which to call. Use switch as many times as desired. For
964 example, passing "-w 0 -w 2 -w 6" will cause calls to be placed on the
965 day the hold was set to waiting, 2 days after the waiting date, and 6
966 days after. See example above. If this switch is not used with
967 --type=RESERVE, calls will be placed every day until the waiting reserve
968 is picked up or canceled.
970 --library-code --code -c
972 OPTIONAL The code of the source library of the message. The library code
973 is used to group notices together for consortium purposes and apply
974 library specific settings, such as prompts, to those notices. This field
975 can be blank if all messages are from a single library.
977 .. _receiving-notices-file-label:
979 Receiving Notices File
980 ''''''''''''''''''''''''''''''''''''''''''''''''''''
982 Script path: misc/cronjobs/thirdparty/TalkingTech\_itiva\_inbound.pl
984 Does: Script to process received Results files for Talking Tech i-tiva
985 phone notification system.
988 :ref:`TalkingTechItivaPhoneNotification`
990 Frequency suggestion: nightly
992 :ref:`Perl Documentation`
997 TalkingTech\_itiva\_inbound.pl
999 TalkingTech\_itiva\_inbound.pl -v --input=/tmp/talkingtech/results.csv
1001 Script to process received Results files for Talking Tech i-tiva phone
1002 notification system.
1008 -v Provide verbose log information.
1012 REQUIRED. Path to incoming results file.
1014 .. _notify-patrons-of-expiration-label:
1016 Notify Patrons of Expiration
1017 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1019 Script path: misc/cronjobs/membership\_expiry.pl
1021 Does: Sends messages to warn patrons of their card expiration to the
1022 :ref:`messaage queue <message-queue-label>` cron.
1024 Requires: :ref:`MembershipExpiryDaysNotice`
1028 .. _in-processing/book-cart-label:
1030 In Processing/Book Cart
1031 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1033 Script path: misc/cronjobs/cart\_to\_shelf.pl
1035 Does: Updates all items with a location of CART to the item's permanent
1038 Required by: :ref:`NewItemsDefaultLocation`,
1039 :ref:`InProcessingToShelvingCart`, &
1040 :ref:`ReturnToShelvingCart` system preferences
1042 Frequency suggestion: hourly
1044 .. _perl-documentation-in-processing-book-cart-label:
1047 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1051 cart\_to\_shelf.pl cron script to set items with location of CART to
1052 original shelving location after X hours. Execute without options for
1058 ~~~~~~~~~~~~~~~~~~~~~~~~~~
1060 .. _check-urls-label:
1063 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1065 Script path: misc/cronjobs/check-url.pl
1067 Does: checks URLs in 856$u field. Script output can now be formatted in
1068 CSV or HTML. The HTML version links directly to MARC biblio record
1071 Frequency suggestion: monthly
1073 Learn more: http://wiki.koha-community.org/wiki/Check-url_enhancements
1075 .. _perl-documentation-check-urls-label:
1078 ''''''''''''''''''''''''''''''''''''''''''
1082 C4::URL::Checker - base object for checking URL stored in Koha DB
1088 use C4::URL::Checker;
1090 my $checker = C4::URL::Checker->new( );
1091 $checker->{ host_default } = 'http://mylib.kohalibrary.com';
1092 my $checked_urls = $checker->check_biblio( 123 );
1093 foreach my $url ( @$checked_urls ) {
1094 print "url: ", $url->{ url A }, "\n",
1095 "is_success: ", $url->{ is_success }, "\n",
1096 "status: ", $url->{ status }, "\n";
1103 Create a URL Checker. The returned object can be used to set default
1108 my $checker = C4::URL::Checker->new( );
1109 $checker->{ host_default } = 'http://mylib.kohalibrary.com';
1113 Check all URL from a biblio record. Returns a pointer to an array
1114 containing all URLs with checking for each of them.
1118 my $checked_urls = $checker->check_biblio( 123 );
1120 With 2 URLs, the returned array will look like that:
1126 'url' => 'http://mylib.tamil.fr/img/62265_0055B.JPG',
1131 'url' => 'http://mylib.tamil.fr//img/62265_0055C.JPG',
1133 'status' => '404 - Page not found'
1139 check-url.pl - Check URLs from 856$u field.
1143 check-url.pl [--verbose\|--help] [--host=http://default.tld]
1145 Scan all URLs found in 856$u of bib records and display if resources are
1150 --host=http://default.tld
1152 Server host used when URL doesn't have one, ie doesn't begin with
1153 'http:'. For example, if --host=http://www.mylib.com, then when 856$u
1154 contains 'img/image.jpg', the url checked is:
1155 http://www.mylib.com/image.jpg'.
1159 Outputs both successful and failed URLs.
1163 Formats output in HTML. The result can be redirected to a file
1164 accessible by http. This way, it's possible to link directly to biblio
1165 record in edit mode. With this parameter --host-pro is required.
1167 --host-pro=http://koha-pro.tld
1169 Server host used to link to biblio record editing page.
1173 Print this help page.
1175 .. _update-authorities-label:
1178 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1180 Script path: misc/migration\_tools/merge\_authority.pl
1182 Does: Updates biblio data with changes to authorities records
1186 The name of this script is misleading. This script does not merge
1187 authorities together it instead merges authority data with linked
1188 bib records. Edits to authority records will be applied to
1189 bibliographic records that use that authority when this script is
1192 Required by: `dontmerge <#dontmerge>`__ system preference
1194 Frequency suggestion: nightly
1196 .. _serials-update-label:
1199 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1201 Script path: misc/cronjobs/serialsUpdate.pl
1203 Does: checks if there is a "late" issue on active subscriptions, and if
1204 there is, the script will set it as late, and add the next one as
1207 Frequency suggestion: nightly
1209 .. _automatic-item-update-label:
1211 Automatic item update
1212 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1214 Script path: misc/cronjobs/automatic\_item\_modification\_by\_age.pl
1216 Does: updates items based on the list of rules set forth in the
1217 :ref:`Automatic item modifications by age` tool
1219 Required by: :ref:`Automatic item modifications by age`
1221 Frequency suggestions: nightly
1223 .. _perl-documentation-automatic-item-update-label:
1226 '''''''''''''''''''''''''''''''''''''''''''''''
1230 automatic\_item\_modification\_by\_age.pl
1234 ./automatic\_item\_modification\_by\_age.pl -h
1236 Toggle recent acquisitions status. Use this script to delete "new"
1241 -h\|--help Prints this help message.
1243 -v\|--verbose Set the verbose flag.
1245 -c\|--confirm The script will modify the items.
1249 Jonathan Druart <jonathan.druart@biblibre.com>
1253 Copyright 2013 BibLibre
1257 This file is part of Koha.
1259 Koha is free software; you can redistribute it and/or modify it under
1260 the terms of the GNU General Public License as published by the Free
1261 Software Foundation; either version 3 of the License, or (at your
1262 option) any later version.
1264 Koha is distributed in the hope that it will be useful, but WITHOUT ANY
1265 WARRANTY; without even the implied warranty of MERCHANTABILITY or
1266 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
1269 You should have received a copy of the GNU General Public License along
1270 with Koha; if not, see <http://www.gnu.org/licenses>.
1275 ~~~~~~~~~~~~~~~~~~~~~
1277 .. _rss-feeds-label:
1280 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1282 Script path: misc/cronjobs/rss/rss.pl
1284 Does: Produces an RSS XML document for any SQL query (not used for
1285 search results RSS feed). :ref:`Learn more <custom-rss-feeds-label>`.
1287 Frequency suggestion: hourly
1289 .. _authorities-browser-label:
1292 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1294 Script path: misc/cronjobs/build\_browser\_and\_cloud.pl
1296 Does: Generate content for authorities browse in OPAC
1298 Required by: :ref:`OpacBrowser` system preference
1302 This preference and cron job should only be used on French systems.
1304 .. _subject/author-clouds-label:
1306 Subject/Author Clouds
1307 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1309 Script path: misc/cronjobs/cloud-kw.pl
1311 Does: Generates HTML keywords clouds from Koha Zebra indexes.
1312 misc/cronjobs/cloud-sample.conf has a sample of how this script
1315 Frequency: This is the type of script you can run once a month or so,
1316 the content generated isn't going to change very much over time.
1318 .. _perl-documentation-subject-author-clouds-label:
1321 '''''''''''''''''''''''''''''''''''''''''''
1325 cloud-kw.pl - Creates HTML keywords clouds from Koha Zebra Indexes
1329 cloud-kw.pl [--verbose\|--help] --conf=cloud.conf
1331 Creates multiple HTML files containing keywords cloud with top terms
1332 sorted by their logarithmic weight. cloud.conf is a YAML configuration
1333 file driving cloud generation process.
1337 --conf=configuration file
1339 Specify configuration file name
1343 Enable script verbose mode.
1347 Print this help page.
1351 Configuration file looks like that:
1356 # Koha configuration file for a specific installation
1357 # If not present, defaults to KOHA_CONF
1358 KohaConf: /home/koha/mylibray/etc/koha-conf.xml
1359 # Zebra index to scan
1361 # Koha index used to link found kewords with an opac search URL
1363 # Number of top keyword to use for the cloud
1365 # Include CSS style directives with the cloud
1366 # This could be used as a model and then CSS directives are
1367 # put in the appropriate CSS file directly.
1369 # HTML file where to output the cloud
1370 Output: /home/koha/mylibrary/koharoot/koha-tmpl/cloud-author.html
1372 KohaConf: /home/koha/yourlibray/etc/koha-conf.xml
1377 Output: /home/koha/yourlibrary/koharoot/koha-tmpl/cloud-subject.html
1381 Generated top terms have more informations than those outputted from the
1382 time being. Some parameters could be easily added to improve this
1387 In order to output terms with the number of occurrences they have been
1388 found in Koha Catalogue by Zebra.
1392 Number of levels in the cloud. Now 24 levels are hardcoded.
1396 Weighting method used to distribute terms in the cloud. We could have
1397 two values: Logarithmic and Linear. Now it's Logarithmic by default.
1401 Now terms are outputted in the lexical order. They could be sorted by
1404 .. _system-administration-label:
1406 System Administration
1407 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1409 .. _clean-up-database-label:
1412 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1414 Script path: misc/cronjobs/cleanup\_database.pl
1416 Does: Truncates the sessions table, cleans out old zebraqueue entries,
1417 action logs and staged MARC files.
1419 .. _perl-documentation-clean-up-database-label:
1426 kohaclone/misc/cronjobs/cleanup\_database.pl [-h\|--help] [--sessions]
1427 [--sessdays DAYS] [-v\|--verbose] [--zebraqueue DAYS] [-m\|--mail]
1428 [--merged] [--import DAYS] [--logs DAYS] [--searchhistory DAYS]
1434 prints this help message, and exits, ignoring all other options
1438 purge the sessions table. If you use this while users are logged into
1439 Koha, they will have to reconnect.
1443 purge only sessions older than DAYS days
1447 will cause the script to give you a bit more information about the run.
1451 purge completed zebraqueue entries older than DAYS days. Defaults to 30
1452 days if no days specified.
1456 purge items from the mail queue that are older than DAYS days. Defaults
1457 to 30 days if no days specified.
1461 purged completed entries from need\_merge\_authorities.
1465 purge records from import tables older than DAYS days. Defaults to 60
1466 days if no days specified
1470 purge records from import tables that are the result of Z39.50 searches
1474 purge entries from action\_logs older than DAYS days. Defaults to 180
1475 days if no days specified
1477 --searchhistory DAYS
1479 purge entries from search\_history older than DAYS days. Defaults to 30
1480 days if no days specified
1484 purge (unaccepted) list share invites older than DAYS days. Defaults to
1485 14 days if no days specified.
1489 purge patrons restrictions expired since more than DAYS days. Defaults
1490 to 30 days if no days specified.
1492 .. _share-usage-stats-label:
1495 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1497 Script path: misc/cronjobs/share\_usage\_with\_koha\_community.pl
1499 Does: If you're sharing information via the :ref:`UsageStats`
1500 feature this will send your info to the `Hea
1501 website <http://hea.koha-community.org/>`__.
1505 .. _perl-documentation-share-usage-stats-label:
1508 '''''''''''''''''''''''''''''''''''''''
1512 share\_usage\_with\_koha\_community.pl - Share your library's usage with
1517 share\_usage\_with\_koha\_community.pl [-h\|--help] [-v\|--verbose]
1519 If the :ref:`UsageStats` system preference is set, you can
1520 launch this script to share your usage data anonymously with the Koha
1523 Collecting Koha usage statistics will help developers to know how Koha
1524 is used across the world.
1526 This script will send the usage data for the bibliographic and authority
1527 records, checkouts, holds, orders, and subscriptions.
1529 Only the total number is retrieved. In no case will private data be
1532 In order to know which parts of Koha modules are used, this script will
1533 collect some system preference values.
1535 If you want to tell us who you are, you can fill the
1536 :ref:`UsageStatsLibraryName` system preference
1537 with your library name,
1538 :ref:`UsageStatsLibraryUrl`,
1539 :ref:`UsageStatsLibraryType` and/or
1540 :ref:`UsageStatsCountry`.
1542 All these data will be analyzed on the http://hea.koha-community.org
1543 Koha community website.
1545 IMPORTANT : please do NOT run the cron on the 1st, but on another day.
1546 The idea is to avoid all Koha libraries sending their data at the same
1547 time ! So choose any day between 1 and 28 !
1553 Print a brief help message
1565 Alex Arnaud <alex.arnaud@biblibre.com>
1567 Jonathan Druart <jonathan.druart@biblibre.com>
1571 Copyright 2014 BibLibre
1575 This file is part of Koha.
1577 Koha is free software; you can redistribute it and/or modify it under
1578 the terms of the GNU General Public License as published by the Free
1579 Software Foundation; either version 3 of the License, or (at your
1580 option) any later version.
1582 You should have received a copy of the GNU General Public License along
1583 with Koha; if not, write to the Free Software Foundation, Inc., 51
1584 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1586 .. _acquisitions-label:
1589 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1591 .. _clean-up-old-suggestions-label:
1593 Clean up old suggestions
1594 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1596 Script path: misc/cronjobs/purge\_suggestions.pl
1598 Does: Removes old (defined by you) suggestions from the suggestion
1601 .. _email-suggestions-to-process-label:
1603 Email suggestions to process
1604 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1606 Script path: misc/cronjobs/notice\_unprocessed\_suggestions.pl
1608 Does: Generates a notice to the fund owner that there are suggestions in
1611 .. _perl-documentation-email-suggestions-to-process-label:
1614 ''''''''''''''''''''''''''''''''''''''''''''''
1618 notice\_unprocessed\_suggestions.pl - Generate notification for
1619 unprocessed suggestions.
1621 The budget owner will be notified.
1623 The letter template 'TO\_PROCESS' will be used.
1627 notice\_unprocessed\_suggestions.pl [-h\|--help] [-v\|--verbose]
1628 [-c\|--confirm] [--days=NUMBER\_OF\_DAYS]
1632 -h\|--help Print a brief help message
1634 -c\|--confirm This flag must be provided in order for the script to
1635 actually generate notices. If it is not supplied, the script will only
1636 report on the patron it would have noticed.
1638 --days This parameter is mandatory. It must contain an integer
1639 representing the number of days elapsed since the last modification of
1640 suggestions to process.
1642 -v\|--verbose Verbose mode.
1644 .. _edi-message-processing-label:
1646 EDI Message Processing
1647 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1649 Script path: misc/cronjobs/edi\_cron.pl
1651 Does: Sends and received EDI messages
1653 Frequency: Every 15 minutes
1655 .. _deprecated-scripts-label:
1658 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1660 These should not be run without modification:
1662 Script path: misc/cronjobs/update\_items.pl
1664 Script path:misc/cronjobs/smsoverdues.pl
1666 Script path:misc/cronjobs/notifyMailsOp.pl
1668 Script path:misc/cronjobs/reservefix.pl
1670 Script path:misc/cronjobs/zebraqueue\_start.pl