Difference between revisions of "EPrints Cron Jobs"
(Added page about EPrints cron jobs) |
(Added issues_audit) |
||
| Line 12: | Line 12: | ||
The <code>generate_sitemap</code> cron job generates a XML sitemap at http://HOSTNAME/sitemap.xml. This sitemap contains links to one or more numbered site maps each of which contain entries for each eprint abstract page in the live archive. As new items are likely to be added continual, it is important to regular update this sitemap to include these new items. | The <code>generate_sitemap</code> cron job generates a XML sitemap at http://HOSTNAME/sitemap.xml. This sitemap contains links to one or more numbered site maps each of which contain entries for each eprint abstract page in the live archive. As new items are likely to be added continual, it is important to regular update this sitemap to include these new items. | ||
| + | |||
| + | The <code>issues_audit</code> cron job analyses eprints records in the whole, detecting things like those that have the same or similar title. | ||
== Other Cron Jobs == | == Other Cron Jobs == | ||
Revision as of 09:15, 11 August 2026
There are various tasks that it is important or useful that EPrints runs on a regular basis. Cron jobs are one of the best and probably simplest ways of achieving this. The best way to add a cron job for EPrints is to open the eprints' user's crontab for editing, as follows:
crontab -e
Default Cron Jobs
There are various different cron jobs you may want to deploy. Below is a template crontab for a vanilla EPrints repositories without extra plugins or ingredients installed.
# Generate browse views 00 01 * * * EPRINTS_PATH/bin/generate_views ARCHIVE_ID --generate menus # Send emails alerts (e.g. editorial reviews) 00 02 * * * EPRINTS_PATH/bin/send_alerts ARCHIVE_ID daily 10 02 * * 0 EPRINTS_PATH/bin/send_alerts ARCHIVE_ID weekly 20 02 1 * * EPRINTS_PATH/bin/send_alerts ARCHIVE_ID monthly # Lift expired embargoes on documents 00 03 * * * EPRINTS_PATH/bin/lift_embargos ARCHIVE_ID >> EPRINTS_PATH/archives/ARCHIVE_ID/var/lift_embargos.log # Generate Site Map 00 04 * * * EPRINTS_PATH/bin/tools/generate_sitemap ARCHIVE_ID # Issues Audit 00 05 * * * EPRINTS_PATH/bin/issues_audit ARCHIVE_ID --quiet
The generate_views cron job is to ensure both menu and listing pages for browse views (found under http://HOSTNAME/views/ and its sub-pages) are updated. Browse views menu and listing pages are typically cached for 24 hours. However, by regenerating these by cron job every 24 hours, they will load more quickly, as they won't needed to be regenerated on-the-fly because the cache has expired. If you have a large EPrints repository with lots of different browse views, you may find this cron job takes several hours to complete.
The send_alerts cron jobs send out emails on a daily, weekly or monthly basis. The most common use of these is to send emails to editors reminding them of items they need to review. Updates on results from saved searches also use the script to send out emails. Other plugins or ingredients may add to the types of email that can be sent out by this scripts.
The lift_embargos cron job checks over all embargoed documents in eprint records and removes the access restriction on these documents if the embargo date has been reached. It is useful to retain the out from this script as the embargo date will also be unset and sometimes this information is required retrospectively, so such a logs file is the most straightforward way of retrieving this. (There are certain flags you can set for lift_embargos if you need the embargo date retained.
The generate_sitemap cron job generates a XML sitemap at http://HOSTNAME/sitemap.xml. This sitemap contains links to one or more numbered site maps each of which contain entries for each eprint abstract page in the live archive. As new items are likely to be added continual, it is important to regular update this sitemap to include these new items.
The issues_audit cron job analyses eprints records in the whole, detecting things like those that have the same or similar title.
Other Cron Jobs
Various plugins and ingredients will use cron jobs to support their functionality. The some of the most common examples are:
1. IRStats2, which need to regularly process the access table to update usage statistics.
30 03 * * * EPRINTS_PATH/ingredients/irstats2/bin/stats/process_stats ARCHIVE_ID >> EPRINTS_PATH/archives/ARCHIVE_ID/var/process_stats.log
2. Coversheets, which needs to generate coversheeted versions of PDFs uploaded for certain eprint items.
*/15 6-17 * * 1-5 EPRINTS_PATH/ingredients/coversheets/bin/check_coversheets ARCHIVE_ID 250 2>&1 | grep -v -f EPRINTS_PATH/ingredients/coversheets/bin/ignore_warnings.txt