aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/api-quotes-backfill.service13
-rw-r--r--scripts/api-quotes-backfill.timer10
-rw-r--r--scripts/api-quotes.timer10
-rw-r--r--scripts/risk.timer10
-rw-r--r--scripts/simplem@.service13
5 files changed, 56 insertions, 0 deletions
diff --git a/scripts/api-quotes-backfill.service b/scripts/api-quotes-backfill.service
new file mode 100644
index 00000000..7b32c11f
--- /dev/null
+++ b/scripts/api-quotes-backfill.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Run API Quotes with backfill
+OnFailure=monitor@%n
+
+[Service]
+Type=simple
+User=guillaume
+Group=guillaume
+ExecStart=/usr/bin/python -m api_quotes -b
+WorkingDirectory=/home/guillaume/projects/code/python
+EnvironmentFile=/etc/serenitas.conf
+Environment=PYTHONPATH=/home/guillaume/projects/code/python
+LoadCredential=serenitas:/etc/credstore
diff --git a/scripts/api-quotes-backfill.timer b/scripts/api-quotes-backfill.timer
new file mode 100644
index 00000000..5736c546
--- /dev/null
+++ b/scripts/api-quotes-backfill.timer
@@ -0,0 +1,10 @@
+[Unit]
+Description=Run api quotes backfill
+
+[Timer]
+OnCalendar=Mon..Fri 20:00
+Unit=api-quotes-backfill.service
+RandomizedDelaySec=1m
+
+[Install]
+WantedBy=timers.target
diff --git a/scripts/api-quotes.timer b/scripts/api-quotes.timer
new file mode 100644
index 00000000..cb640553
--- /dev/null
+++ b/scripts/api-quotes.timer
@@ -0,0 +1,10 @@
+[Unit]
+Description=Runs API Quotes every 5 minutes
+
+[Timer]
+OnBootSec=1min
+OnUnitActiveSec=5min
+Unit=simplem@api_quotes.service
+
+[Install]
+WantedBy=timers.target
diff --git a/scripts/risk.timer b/scripts/risk.timer
new file mode 100644
index 00000000..9e522703
--- /dev/null
+++ b/scripts/risk.timer
@@ -0,0 +1,10 @@
+[Unit]
+Description=Run risk module
+
+[Timer]
+OnCalendar=Mon..Fri 7:10
+Unit=simplem@risk.service
+RandomizedDelaySec=1m
+
+[Install]
+WantedBy=timers.target
diff --git a/scripts/simplem@.service b/scripts/simplem@.service
new file mode 100644
index 00000000..0ac14885
--- /dev/null
+++ b/scripts/simplem@.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Simple python module script runner
+OnFailure=monitor@%n
+
+[Service]
+Type=simple
+User=guillaume
+Group=guillaume
+ExecStart=/usr/bin/python -m %i
+WorkingDirectory=/home/guillaume/projects/code/python
+EnvironmentFile=/etc/serenitas.conf
+Environment=PYTHONPATH=/home/guillaume/projects/code/python
+LoadCredential=serenitas:/etc/credstore