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:
parent
431a1c9d64
commit
90d7a452bd
14
contrib/dspace-statistics-indexer.service
Normal file
14
contrib/dspace-statistics-indexer.service
Normal 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
|
12
contrib/dspace-statistics-indexer.timer
Normal file
12
contrib/dspace-statistics-indexer.timer
Normal 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 0–3600 seconds
|
||||
RandomizedDelaySec=3600
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
Loading…
Reference in New Issue
Block a user