systemd units
This commit is contained in:
parent
b80d2851d6
commit
2b470cedb5
2 changed files with 21 additions and 0 deletions
12
systemd/moodle-import-worker.service
Normal file
12
systemd/moodle-import-worker.service
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Moodle Import Worker
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
|
||||||
|
# Needs to run as the user Moodle runs as
|
||||||
|
User=www-data
|
||||||
|
Group=www-data
|
||||||
|
|
||||||
|
WorkingDirectory=/opt/moodle-import-worker/
|
||||||
|
ExecStart=/usr/bin/env python3 /opt/moodle-import-worker/worker.py
|
9
systemd/moodle-import-worker.timer
Normal file
9
systemd/moodle-import-worker.timer
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Run Moodle Import Worker every minute
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnBootSec=1min
|
||||||
|
OnUnitActiveSec=1min
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
Loading…
Reference in a new issue