Quickstart:Configure EPrints: Difference between revisions
No edit summary |
No edit summary |
||
| Line 44: | Line 44: | ||
== Cron Extras == | == Cron Extras == | ||
== Embargos == | |||
In EPrints, an embargo is a temporary delay placed on making the full-text file or document of a research deposit publicly accessible to the open web. | |||
We need to add a trigger to our cron to lift embargos at the end of the period set. | |||
<i>(make sure to replace <code>ARCHIVE_ID</code> with your archive name, the name of the directory you created in <code>/opt/eprints3/archives/</code>)</i><br/> | <i>(make sure to replace <code>ARCHIVE_ID</code> with your archive name, the name of the directory you created in <code>/opt/eprints3/archives/</code>)</i><br/> | ||
# Lift expired embargoes on documents | # Lift expired embargoes on documents | ||
00 03 * * * opt/eprints3/bin/lift_embargos ARCHIVE_ID >> EPRINTS_PATH/archives/ARCHIVE_ID/var/lift_embargos.log | 00 03 * * * opt/eprints3/bin/lift_embargos ARCHIVE_ID >> EPRINTS_PATH/archives/ARCHIVE_ID/var/lift_embargos.log | ||
Revision as of 10:48, 8 October 2026
This page assumes you have completed the previous pages in the Quickstart Guide.
Automate with Cron
When you create an archive it will start out as a development system while you learn how to set it up, but at some point before launch you will want to automate common actions to happen on a schedule. The best way to do this is to use "cron" which is an integral part of most UNIX systems.
To set up cron, run (as the eprints user):
% crontab -e
Exactly what to add to the cron table is described in the following sections on this page.
For more information about the Cron, see our EPrints Cron Jobs page.
'Browse Views'
Once every so often you should run the "generate_views" script on each archive in your system to regenerate the browse views section of the site.
(make sure to replace ARCHIVE_ID with your archive name, the name of the directory you created in /opt/eprints3/archives/)
opt/eprints3/bin/generate_views ARCHIVE_ID --generate menus
This is a set of static pages. By default one per subject, and one per year (only years with papers in that year not EVERY year ever!). Some users prefer to browse the system than search it. This also gives search engines a way to reach, and index, the abstract pages.
We have additional guides to delve deeper into how to setup your views.
Now Add to Cron
Keeping your 'Browse' views is best done by using the UNIX "cron" command (as user "eprints"). Cron will email "eprints" on that machine with the output, so best use the --quiet option so it only bothers you with errors.
How often you want to run this depends on the size of your archive, and how fast the contents changes. A rough estimate for how long it takes is that if you double the number of items in your archive then you double the time it takes to run (ish).
Once an hour would seem a good starting point. If your archive gets real big, say more than 10000 records, then maybe once a day is more realistic - the one thing that you don't want to happen is for a new generate_views to start before the old one finishes as they will mess up each others output.
Run generate_views on the command line to find out how long it takes.
and add the line
23 * * * opt/eprints3/bin/generate_views ARCHIVE_ID --generate menus
This runs at 23 minutes past each hour. If you have more than one archive, don't make them all start rebuilding stuff at the same time, stagger it. Otherwise once an hour everything will slow down as it fights to run several intensive scripts at once.
Email Alerts
The most common use of email alerts 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.
To make the emails actually send, you need to add the triggers to you cron table.
(make sure to replace ARCHIVE_ID with your archive name, the name of the directory you created in /opt/eprints3/archives/)
# Send emails alerts (e.g. editorial reviews) 00 02 * * * opt/eprints3/bin/send_alerts ARCHIVE_ID daily 10 02 * * 0 opt/eprints3/bin/send_alerts ARCHIVE_ID weekly 20 02 1 * * opt/eprints3/bin/send_alerts ARCHIVE_ID monthly
Cron Extras
Embargos
In EPrints, an embargo is a temporary delay placed on making the full-text file or document of a research deposit publicly accessible to the open web.
We need to add a trigger to our cron to lift embargos at the end of the period set.
(make sure to replace ARCHIVE_ID with your archive name, the name of the directory you created in /opt/eprints3/archives/)
# Lift expired embargoes on documents 00 03 * * * opt/eprints3/bin/lift_embargos ARCHIVE_ID >> EPRINTS_PATH/archives/ARCHIVE_ID/var/lift_embargos.log
# Generate Site Map 00 04 * * * opt/eprints3/bin/tools/generate_sitemap ARCHIVE_ID
# Issues Audit 00 05 * * * opt/eprints3/bin/issues_audit ARCHIVE_ID --quiet