Jump to content

Quickstart:Configure EPrints: Difference between revisions

From EPrints Documentation
Ap1e26 (talk | contribs)
No edit summary
Ap1e26 (talk | contribs)
 
Line 67: Line 67:
<i>(make sure to replace <code>EPRINTS_PATH</code> with the path to your eprints install, in this guide it is <code>/opt/eprints3</code>)</i><br/>
<i>(make sure to replace <code>EPRINTS_PATH</code> with the path to your eprints install, in this guide it is <code>/opt/eprints3</code>)</i><br/>
{{template:EPrints_Crontab_Template}}
{{template:EPrints_Crontab_Template}}
= OAI =
We would also encourage you to configure the OAI support for your archive and register it. It's quite easy - pretty much fill in the blanks in the ArchiveOAIConfig.pm file in the archive configuration directory.
EPrints 2.1 support OAI versions 1 and 2 at URL paths /perl/oai and /perl/oai2.
Once you register your archive (at http://www.openarchives.org) various search systems will be able to collect the metadata (titles, authors, abstract etc.) and allow more people to find records in your archive.
See http://www.openarchives.org/ for more information on the OAI protocol. For more information setting up the OAI interface archive see the section in this documentation about Configuring an Archive.


= Next Steps =
= Next Steps =
You are now ready to customise the EPrints system! Go to the [[Quickstart:Customise EPrints | next page of this guide]] to find out how.
You are now ready to customise the EPrints system! Go to the [[Quickstart:Customise EPrints | next page of this guide]] to find out how.

Latest revision as of 11:11, 8 October 2026


This page assumes you have completed the previous pages in the Quickstart Guide.

Automate with Cron[edit]

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'[edit]

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[edit]

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[edit]

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

Embargos[edit]

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

Site Maps and Audits[edit]

Site Map[edit]

A site map (or sitemap) is a structured file that details the pages, files, and relationships across a website. It acts as a blueprint for search engine crawlers to discover, and index your pages faster and more reliably, improving your standing in search results.

# Generate Site Map
00 04 * * * opt/eprints3/bin/tools/generate_sitemap ARCHIVE_ID

Issues Audit[edit]

The issues_audit cron job analyses eprints records in the whole, detecting things like those that have the same or similar title.

# Issues Audit
00 05 * * * opt/eprints3/bin/issues_audit ARCHIVE_ID --quiet

Example Cron Table[edit]

Your complete Cron Table should now look like the one below.

(make sure to replace ARCHIVE_ID with your archive name, the name of the directory you created in /opt/eprints3/archives/)
(make sure to replace EPRINTS_PATH with the path to your eprints install, in this guide it is /opt/eprints3)

# 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

Next Steps[edit]

You are now ready to customise the EPrints system! Go to the next page of this guide to find out how.