Cron jobs and daemons
Koha is supported by a number of background tasks. These tasks can either be periodically executed tasks (cron jobs) or continuously running tasks called daemons.
A cron job is a Linux command for scheduling a command or script on your server to complete repetitive tasks automatically. Scripts executed as a cron job are typically used to modify files or databases; however, they can perform other tasks that do not modify data on the server, like sending out email notifications.
A daemon is a Linux command that is typically started when the system is booted and runs in the background doing some function. The database used by Koha (either MySQL or MariaDB) is a daemon as is the web server (typically Apache).
Koha has many cron jobs in place that you can enable (search engine indexing, overdue notice generation, data cleanup and more), and a few daemons. This chapter will explain those for you.
Crontab örneği
Koha crontab örneği misc/cronjobs/ crontab.example dosyasında bulunabilir.
The example includes sample boilerplate cron job entries for the most commonly-used cron jobs.
Cron jobs
Aşağıdaki konumlar bir kurulumun cron dosyalarını misc/ içine koyduğunu varsayar, Standart bir kurulum yaptıysanız, bu dosyaları misc/ içinde bulamazsanız bin/ içine bakın.
Yedekleme
Daily backup
Komut dosyası yolu: misc/cronjobs/backup.sh
Does: creates a daily backup of the Koha database.
Frekans önerisi: günlük
Ara
Site Haritası
Komut dizisi yolu: misc/cronjobs/sitemap.pl
Does: processes all biblio records from a Koha instance and generates sitemap files complying with the protocol as described on http://sitemaps.org. The goal of this script is to be able to provide to search engines direct access to biblio records. It avoids leaving search engines browsing Koha’s OPAC which would generate a lot of site traffic and server workload.
Not sitemapindex.xml isimli bir dosya üretilir. Birden fazla site haritası dosyasına referanslar içerir. Her dosya en fazla 50.000 URL içerir ve sitemapXXXX.xml olarak adlandırılır.
Dosyalar Koha OPAC’ın kök dizininde saklanmalıdır. Aynı dizinde aşağıdaki içeriklere sahip bir robots.txt dosyası gereklidir:
Site haritası: sitemapindex.xml User-agent: * Disallow: /cgi-bin/
Rebuild index
Komut dizisi yolu: misc/migration_tools/rebuild_zebra.pl
Does: updates Zebra indexes with recently changed data.
Gerek duyan: Zebra
Frekans önerisi: her x dakikada, (5-15 dakika arası) performans ihtiyaçlarına bağlı olarak
Note On newer Koha installations, this cron job has been replaced by the koha-indexer daemon which indexes new and modified Koha data every 30 seconds.
Dolaşım
Holds queue
Komut dizisi yolu: misc/cronjobs/holds/build_holds_queue.pl
Does: updates holds queue report
Required by: Holds queue report
Frekans önerisi: her 1-4 saatte
Tanım:
Kütüphane sisteminiz okuyucuların raftaki materyaller üzerinde ayırtma yapmalarına izin veriyorsa periyodik olarak çalıştırılması gereken bir betiktir. Bu betik, gelen bir ayırtma talebini karşılamak için hangi kütüphanenin sorumlu olacağını belirler.
It’s behavior is controlled by the system preferences StaticHoldsQueueWeight and RandomizeHoldsQueueWeight.
Kütüphanelerinizin raf üzerinde ayırtma isteklerini yerine getirme işlemine katılmasını istemiyorsanız, *katılmakta* olan tüm kütüphanenin birim kodlarını virgüllerle ayırarak girerek, işleme katılmayı sağlayan kitaplıklarını listelemelisiniz (ör. “MPL, CPL, SPL, BML” vb.).
Ayırtma sırası varsayılan olarak, sistemin öncelikle ayırtma isteğinin halihazırda alınacağı kütüphanede mevcut olan materyalleri kullanarak gerçekleştireceği şekilde oluşturulacaktır. Bir ayırtma isteğini yerine getirecek materyal kütüphanede yoksa, build_holds__queue.pl bu sefer StaticHoldsQueueWeight içerisinde tanımlı kütüphanelerin listesini kullanacaktır. Eğer RandomizeHoldsQueueWeight devre dışı ise (varsayılan olarak devre dışıdır), komut dizini ayırtma isteklerini birimlerin StaticHoldsQueueWeight sistem tercihinde yer alma sırasına göre atayacaktır.
Örneğin, sisteminizin değişen boyutlarda (küçük, orta ve büyük) 3 kütüphanesi varsa ve siz ayırmaları daha küçük kütüphanelerden önce daha büyük kütüphanelere yüklemek istiyorsanız, Ayırma Kuyruğundaki Statik Tercihlerin “LRG,MED,SML” şeklinde gözükmesini isteyeceksiniz.
Ayırma yapma işlemleri yükünün kütüphane sisteminizin genelinde eşit olarak dağılmasını istiyorsanız, Ayırma Kuyruğu Rastgele Tercihlerini etkinleştiriniz. Bu sistem tercihi etkinleştirildiğinde, kütüphanelerdeki raflarda ayırma yapma isteği liste her defasında tekrar oluşturulduğunda rastgele hale getirilecektir.
StaticHoldsQueueWeight tercihlerini boş bırakmak ters etki yapmaktadır. Bu şekilde yapmak, build_holds_queue kodunun RandomizeHoldsQueueWeight Tercihlerini görmezden gelmesine, bu da kodun rastgele yerine alfabetik sıraya göre ayırtma yapmasına sebep olacaktır.
Expired holds
Komut dizisi yolu: misc/cronjobs/holds/cancel_expired_holds.pl
Does: cancels holds where the user has set an expiration date. If the library is using the ExpireReservesMaxPickUpDelay and ExpireReservesMaxPickUpDelayCharge preferences then this script will also cancel holds that have been sitting on the hold shelf for too long and will (if the library does) charge the patron for not picking up the hold.
Frekans önerisi: günlük
Unsuspend holds
Komut dizisi yolu: misc/cronjobs/holds/auto_unsuspend_holds.pl
Does: checks to find holds that should no longer be suspended and removes the suspension if the AutoResumeSuspendedHolds preference is set to ‘allow’. This puts the patron back in to the queue where they were when the hold was suspended.
Frekans önerisi: günlük
Cezalar
Komut dizisi yolu: misc/cronjobs/fines.pl
Does: calculates and charges (or increments) overdue fines per item to patron accounts. The fine calculation is done using the grace period, fine interval, fine amount and other parameters from the circulation and fines rules.
Gerek duyan: finesMode sistem tercihi
Frekans önerisi: gecelik
Note If the Koha system preference ‘finesMode’ is set to ‘production’, the fines are charged to the patron accounts. If set to ‘test’, the fines are calculated but not applied.
Note Fines will not be applied on a holiday.
Static fines
Komut dizisi yolu: misc/cronjobs/staticfines.pl
Does: charges a single static fine for any/all overdues a patron currently has outstanding. The charge amount is either defined on the command line per borrower category or will use the circulation rules associated with the oldest overdue item the patron has currently checked out (for the first fine period only) Once charged, the fine is static: No new fines will be added until the existing fine is paid off in full.
Frekans önerisi: gecelik
Note If the Koha system preference ‘finesMode’ is set to ‘production’, the fines are charged to the patron accounts. If set to ‘test’, the fines are calculated but not applied.
Not Para cezaları tatil günlerinde uygulanmaz.
Long overdues
Komut dizisi yolu: misc/cronjobs/longoverdue.pl
Ne yapar: materyallerin farklı kayıp durumlarına değiştirilmesi için gecikmeler belirlemenizi sağlar, ve isteğe bağlı olarak materyal kaydında belirtilen liste fiyatına göre yerine koyma bedeli tahsil etmenizi sağlar.
Frekans önerisi: gecelik
Not
Staff can control some of the parameters for the longoverdue cron job with the DefaultLongOverdueLostValue and DefaultLongOverdueChargeValue preferences.
Track total checkouts
Komut dosyası yolu: misc/cronjobs/update_totalissues.pl
Ne yapar: Ödünç verme istatistiklerini temel alarak en son ödünç alma verileri ile birlikte veri tabanındaki biblioitems.totalissues alanını günceller.
Frekans önerisi: gecelik
Uyarı
Veritabanı sunucunuzun zamanı, Koha sunucunuzun zamanı ile eşleşmiyorsa bu durumu dikkate almanız ve artımlı güncelleştirme için muhtemelen –interval bağımsız değişkeni yerine –since bağımsız değişkenini kullanmanız gerekecektir.
Not
Bir performans endişesi varsa bu cronjob kullanılabilir. Aksi takdirde, UpdateTotalIssuesOnCirc Sistem Tercihi’ni kullanın.
Generate patron file for offline circulation
Komut dizisi yolu: misc/cronjobs/create_koc_db.pl
Does: generates the borrowers.db file for use with the Koha offline circulation tool
Frekans önerisi: haftalık
Otomatik süre uzatma
Komut dizisi yolu: misc/cronjobs/automatic_renewals.pl
Does: renews items if you’re allowing automatic renewal with your circulation and fines rules.
Frekans önerisi: gecelik
Kullanıcılar
Batch delete patrons
Komut dizisi yolu: misc/cronjobs/delete_patrons.pl
Does: deletes patron records in batch based on date not borrowed since, expired before, last seen, category code, or library branch.
Not
Dates should be in ISO format, e.g., 2013-07-19, and can be generated with date -d ‘-3 month’ “+%Y-%m-%d”.
Önemli
The options to select the patron records to delete are cumulative. For example, supplying both –expired_before and –library specifies that patron records must meet both conditions to be selected for deletion.
PARAMETERS
–not_borrowed_since Delete patrons who have not borrowed since this date.
–expired_before Delete patrons with an account expired before this date.
–last_seen Delete patrons who have not been connected since this date. The system preference TrackLastPatronActivity must be enabled to use this option.
–category_code Delete patrons who have this category code.
–library Delete patrons in this library.
-c|–confirm This flag must be provided in order for the script to actually delete patron records. If it is not supplied, the script will only report on the patron records it would have deleted.
-v|–verbose Verbose mode.
Unverified registrations
Komut dizisi yolu: misc/cronjobs/delete_expired_opac_registrations.pl
Does: deletes patron registrations that were submitted via the OPAC but not reviewed by the library within the number of days entered in the PatronSelfRegistrationExpireTemporaryAccountsDelay preference.
Frekans önerisi: gecelik
Unconfirmed registrations
Komut dosyası yolu: misc/cronjobs/delete_unverified_opac_registrations.pl
Does: deletes patron self registrations that were submitted via the OPAC but not confirmed via email within 24 hours. This is only necessary if you are requiring patrons to confirm their registrations via email with the PatronSelfRegistrationVerifyByEmail preference.
Frekans önerisi: saatlik
Anonymize patron data
Komut dosyası yolu: misc/cronjobs/batch_anonymise.pl
Does: removes borrowernumbers from circulation history so that the stats are kept, but the patron information is removed for privacy reasons.
Update child to adult patron type
Komut dosyası yolu: misc/cronjobs/j2a.pl
Does: converts juvenile/child patrons from juvenile patron category and category code to corresponding adult patron category and category code when they reach the upper age limit defined in the Patron Categories.
Frekans önerisi: gecelik
AÇIKLAMA
Bu komut dosyası, kullanıcıları çocuk statüsünden yetişkin statüsüne güncellemek, garantörlerini kaldırmak ve Kullanıcı Kategorisinde tanımlanan üst yaş sınırına ulaştığınızda kategori kodlarını uygun şekilde güncellemek için tasarlanmıştır.
KULLANIM ÖRNEKLERİ
“juv2adult.pl”
“juv2adult.pl” -b=<branchcode> -f=<categorycode> -t=<categorycode> (tek bir alt grup işler ve kullanıcı kategorilerini fromcat kategorisinden tocat kategorisine günceller)
“juv2adult.pl” -f=<categorycode> -t=<categorycode> -v -n (Tüm alt grupları işler, tüm mesajları gösterir ve etkilenecek olan kullanıcıları raporlar. Veri tabanı üzerinde herhangi bir eylemde bulunmaz)
Uyarılar
Message queue
Komut dizisi yolu: misc/cronjobs/process_message_queue.pl
Ne yapar: ödünç verme, iade alma ve onaylanan ayırtma işlemlerini kullanıcılara SMS ve e-posta ile göndermek için ileti sırasını işler. EnhancedMessagingPreferences sistem tercihinin açık olmasını gerektirir
Frekans önerisi: 1-4 saat
Önemli
Item due and Advanced due notices are controlled by the advance_notices cron.
Advanced notice
Komut dosyası yolu: misc/cronjobs/advance_notices.pl
Ne yapar: Talep eden kullanıcılar için “pre-due” ve “item due” bildirimlerini hazırlar, kullanıcılar için süresi yeni dolmuş ve yakında süresi dolacak olan materyallerin bildirimlerini hazırlar. EnhancedMessagingPreferences sistem tercihinin açık olmasını gerektirir.
Frekans önerisi: gecelik
Not
This script does not actually send the notices. It queues them in the message queue for later
Overdue notice
Komut dizisi yolu: misc/cronjobs/overdue_notices.pl
Ne yapar: Gecikmeye kalan kullanıcıları uyarmak için gecikme mesajlarını hazırlar (hem e-posta hem de basılı olarak)
Frekans önerisi: gecelik
Not
This script does not actually send the notices. It queues them in the message queue for later or generates the HTML for later printing
Ayrıca bakınız
misc/cronjobs/advance_notices.pl programı kullanıcılara ödünç aldıkları materyallerin iade zamanı gelmeden önce mesaj gönderebilmenizi, veya üzerlerindeki materyallerin iade zamanı gelir gelmez uyarmanızı sağlar.
Print overdues
Komut dizisi yolu: misc/cronjobs/printoverdues.sh
Ne yapar: Dizinlerdeki HTML dosyalarından PDF dosyaları oluşturur ve yazdırır
Print hold notices
Komut dosyası yolu: misc/cronjobs/gather_print_notices.pl
Ne yapar: Kullanıcının bir e-posta adresi olmadığı için gönderilmeyen ayırtma bildirimleri için mesaj kuyruğu boyunca arama yapar ve bir yazdırma bildirimi oluşturur
Frekans önerisi: gecelik
Talking Tech
Bu üçüncü parti ürünü kurmak hakkında daha fazla bilgi için :ref:`Talking Tech <talking-tech-label> bölümüne gidiniz.
Sending notices file
Komut dosyası yolu: misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl
Does: generates Spec C outbound notifications file for Talking Tech i-tiva phone notification system.
Gerek duyan: TalkingTechItivaPhoneNotification
Frekans önerisi: gecelik
Receiving notices file
Komut dosyası yolu: misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl
Does: processes received results files for Talking Tech i-tiva phone notification system.
Gerek duyan: TalkingTechItivaPhoneNotification
Frekans önerisi: gecelik
Notify patrons of expiration
Komut dizisi yolu: misc/cronjobs/membership_expiry.pl
Does: sends messages to warn patrons of their card expiration to the message queue cron.
Şunu gerektirir: MembershipExpiryDaysNotice
Frekans: her gece
In processing/book cart
Komut dosyası yolu: misc/cronjobs/cart_to_shelf.pl
Does: updates all items with a location of CART to the item’s permanent location.
Required by: NewItemsDefaultLocation, InProcessingToShelvingCart, and ReturnToShelvingCart system preferences
Frekans önerisi: saatlik
Katalog
Import webservice batch
Komut dosyası: misc/cronjobs/import_webservice_batch.pl
Does: processes import bach queues of type ‘webservice’. Batches can also be processed through the UI.
Not
Bu betik OCLC Connexion için kullanılır
Connexion import daemon
Komut dizisi yolu: misc/bin/connexion_import_daemon.pl
Does: listens for OCLC Connexion requests and is compliant with OCLC Gateway specification. It takes requests with MARC XML and import batch parameters from a configuration file and forwards it to svc/import_bib
Not
Bu betik OCLC Connexion için kullanılır
Batch item deletion
Komut dizisi yolu: misc/cronjobs/delete_items.pl
Does: generates a query against the items database and deletes the items matching the criteria specified in the command line arguments.
PARAMETERS
–verbose Send the “WHERE” clause generated by the collected C<–where> arguments, as well as items affected to Standard Out.
–where The C<–where> option may called multiple times. The following argument must be a syntactically valid SQL statement which is part of the C<WHERE> clause querying the items table. These are joined by C<AND>.
–commit No items will be deleted unless the C<–commit> flag is present.
EXAMPLES
The following are examples of this script:
delete_items.pl –where “items.withdrawn ! 0” –where “items.withdrawn_on < $(date –date=”13 month ago” –rfc-3339=date)” –commit
delete_items.pl –where “itemlost >= ‘1’” –where “itemlost <=’4’” –where “itemlost_on < ‘2014-04-28’” –commit
Check URL quick
Komut dosyası yolu: misc/cronjobs/check-url-quick.pl
Does: checks URLs from biblio records; scans all URLs found by default in 856$u of bibliographic records and displays if resources are available or not.
Not
Bu betik check-url.pl betiğinin yerini alır.
PARAMETERS
–host=http://default.tld Server host used when URL doesn’t have one, ie doesn’t begin with ‘http:’. For example, if –host=mylib.com, then when 856$u contains ‘img/image.jpg’, the url checked is: http://www.mylib.com/image.jpg.
–tags Tags containing URLs in $u subfields. If not provided, 856 tag is checked. Multiple tags can be specified, for example:
check-url-quick.pl –tags 310 410 856
–verbose|v Outputs both successful and failed URLs.
–html Formats output in HTML. The result can be redirected to a file accessible by http. This way, it’s possible to link directly to the bibliographic record in edit mode. With this parameter –host-intranet is required.
–host-intranet=http://koha-pro.tld Server host used to link to bibliographic record editing page in Koha intranet interface.
–timeout=10 Timeout for fetching URLs. By default 10 seconds.
–maxconn=1000 Number of simulaneous HTTP requests. By default 200 connexions.
URL’leri denetleyin
Komut dosyası yolu: misc/cronjobs/check-url.pl
Ne yapar: 856$u alanındaki URL’leri denetler. Komut dizisi çıktısı şimdi CSV veya HTML biçiminde olabilir. HTML sürümü doğrudan MARC biblio kayıt editörüne bağlantılıdır.
Frekans önerisi: aylık
Daha fazla bilgi için: http://wiki.koha-community.org/wiki/Check-url_enhancements
Delete records via leader
Komut dizisi yolu: misc/cronjobs/delete_records_via_leader.pl
Does: attempts to delete any MARC records where the leader character 5 equals ‘d’.
PARAMETERS
-c|–confirm Script will do nothing without this parameter
-v|–verbose Verbose mode
-t|–test Test mode, does not delete records. Test mode cannot determine if a record/item will be deleted successfully, it will only tell you what records and items the script will attempt to delete.
-i|–delete-items Try deleting items before deleting record. Records with items cannot be deleted.
Serials update
Komut dizisi yolu: misc/cronjobs/serialsUpdate.pl
Ne yapar: Aktif aboneliklerde “gecikmiş” bir sayı olup olmadığını kontrol eder, eğer gecikmiş bir sayı varsa, komut dizisi bunu ‘gecikmiş’ olarak ayarlayacak ve bir sonrakini ‘bekleniyor’ olarak ekleyecektir.
Frekans önerisi: gecelik
Otomatik materyal güncelleme
Komut dosyası yolu: misc/cronjobs/automatic_item_modification_by_age.pl
Ne yapar: Yaşa göre otomatik materyal değişiklikleri aracında belirtilen kurallar listesini temel alarak materyalleri günceller
Gerek duyan: Yaşa göre otomatik materyal değişiklikleri
Sıklık önerileri: her gece
OPAC
RSS feeds
Komut dizisi yolu: misc/cronjobs/rss/rss.pl
Does: produces an RSS XML document for any SQL query (not used for search results RSS feed). Learn more.
Frekans önerisi: saatlik
System administration
Services throttle
Komut dizisi yolu: misc/cronjobs/services_throttle.pl
Ne yapar: xISBN services throttle’ı resetler
Frekans önerisi: gecelik
Clean up database
Komut dizisi yolu: misc/cronjobs/cleanup_database.pl
Does: truncates the sessions table, cleans out old zebraqueue entries, action logs and staged MARC files.
Sağlama
Eski önerileri temizle
Komut dizisi yolu: misc/cronjobs/purge_suggestions.pl
Does: removes old (defined by you) suggestions from the suggestion management area.
Not
PurgeSuggestionsOlderThan sistem tercihi komut dosyasında kullanılan gün sayısını tanımlar
İşlenecek e-posta önerileri
Komut dizisi yolu: misc/cronjobs/notice_unprocessed_suggestions.pl
Does: generates a notice to the fund owner that there are suggestions in need of processing
EDI message processing
Komut dizisi yolu: misc/cronjobs/edi_cron.pl
Does: sends and received EDI messages
Frekans: Her 15 dakikada bir
Remove temporary EDI files
Komut dizisi yolu: misc/cronjobs/remove_temporary_edifiles.pl
Ne yapar: 5 günden eski olan geçici EDI dosyalarını kaldırır
Raporlar
Run report
Komut dizisi yolu: misc/cronjobs/runreport.pl
Does: runs pre-existing saved reports
PARAMETERS
-v|–verbose Verbose output
–format=s Selects format. Choice of text, html, csv or tsv
-e|–email Whether or not to use e-mail (implied by –to or –from)
-a|–attachment Attach the report as a file. Cannot be used with html format
–username Username to pass to the SMTP server for authentication
–password Password to pass to the SMTP server for authentication
–method The type of authentication. Ie. LOGIN, DIGEST-MD5, etc.
–to=s E-mail address to send report to
–from=s E-mail address to send report from
–subject=s Subject for the e-mail
–store-results Store the result of the report
–csv-header Add column names as first line of csv output
ARGUMENTS
reportID Report ID Number from saved_sql.id, multiple ID’s may be specified
Norveç kullanıcı veritabanı
Koha için NL senkronizasyonu
Komut dizisi yolu: misc/cronjobs/nl-sync-to-koha.pl
Does: syncs patrons from the Norwegian national patron database (NL) to Koha
Not NorwegianPatronDBUsername ve NorwegianPatronDBPassword sistem tercihlerine güvenir.
Koha’dan NL senkronizasyonu
Komut dizisi yolu: misc/cronjobs/nl-sync-from-koha.pl
Does: syncs patrons from Koha to the Norwegian national patron database (NL)
Not NorwegianPatronDBUsername ve NorwegianPatronDBPassword sistem tercihlerine güvenir.
Daemons
Daemons are continuously running tasks that help support Koha operation. Your database and webserver are run as daemons. Newer versions of Koha start two different daemons for most koha instances:
zebra - this is the index server
koha-indexer - this daemon updates the index server with new and modified data (biblios and authorities)
These daemons are started by the script /etc/init.d/koha-common.
Zebra indexer daemon
Script path: /usr/sbin/koha-indexer (invoked from /etc/init.d/koha-common)
The koha-indexer script invokes rebuild_zebra.pl in daemon mode. In this mode, the script will run continuously and check the database for new or modified data every 30 seconds. New or modified records are then sent to Zebra for indexing, which only takes a second or so. The advantage of this approach is a search system which is much more responsive to changes, compared to the cron job approach.
Artık kullanılmayan komut dosyaları
Bunlar üzerlerinde değişiklik yapılmadan çalıştırılmamalıdır:
Komut dizisi yolu: misc/cronjobs/update_items.pl
Komut dizisi yolu:misc/cronjobs/smsoverdues.pl
Komut dizisi yolu:misc/cronjobs/notifyMailsOp.pl
Komut dosyası yolu:misc/cronjobs/reservefix.pl
Komut dizisi yolu: misc/cronjobs/zebraqueue_start.pl
Sosyal veri
Sosyal veri raporunu al
Komut dizisi yolu: misc/cronjobs/social_data/get_report_social_data.pl
Ne yapar: OPAC kayıtlarına eklemek için Babelthèque’den veri indirir
Frekans önerisi: gecelik
Sosyal veriyi güncelle
Komut dizisi yolu: misc/cronjobs/social_data/update_social_data.pl
Ne yapar: Babelthèque sosyal verileriyle OPAC kayıtlarını günceller