1
0
mirror of https://github.com/ilri/dspace-statistics-api.git synced 2024-12-22 12:42:19 +01:00

contrib: Add systemd units for indexer

An example systemd service unit for the indexer and an accompanying
timer unit.
This commit is contained in:
Alan Orth 2018-09-23 23:13:43 +03:00
parent 431a1c9d64
commit 90d7a452bd
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,14 @@
[Unit]
Description=CGSpace Statistics Indexer
After=tomcat7.target
[Service]
Environment=SOLR_SERVER=http://localhost:8081/solr
Environment=SOLR_CORE=statistics
User=nobody
Group=nogroup
WorkingDirectory=/opt/ilri/cgspace-statistics-api
ExecStart=/opt/ilri/cgspace-statistics-api/venv/bin/python indexer.py
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,12 @@
[Unit]
Description=CGSpace Statistics Indexer
[Timer]
# twice a day, at 6AM and 6PM
OnCalendar=*-*-* 06:00:00,18:00:00
# Add a random delay of 03600 seconds
RandomizedDelaySec=3600
Persistent=true
[Install]
WantedBy=timers.target