summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/everytea-fetch.service12
-rw-r--r--etc/everytea-fetch.timer10
-rw-r--r--etc/everytea.service15
3 files changed, 37 insertions, 0 deletions
diff --git a/etc/everytea-fetch.service b/etc/everytea-fetch.service
new file mode 100644
index 0000000..e18a5e5
--- /dev/null
+++ b/etc/everytea-fetch.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Fetch and parse everytea.ru
+Wants=everytea-fetch.timer
+
+[Service]
+Type=oneshot
+User=root
+WorkingDirectory=/root/everytea.ru
+ExecStart=/usr/local/bin/luna -n 1 /root/everytea.ru/main.lua /root/everytea.ru/bin/fetch.fnl
+
+[Install]
+WantedBy=multi-user.target
diff --git a/etc/everytea-fetch.timer b/etc/everytea-fetch.timer
new file mode 100644
index 0000000..80f45cb
--- /dev/null
+++ b/etc/everytea-fetch.timer
@@ -0,0 +1,10 @@
+[Unit]
+Description=Run fetching and parsing every night
+
+[Timer]
+Persistent=true
+Unit=everytea-fetch.service
+OnCalendar=*-*-* 00:00:00
+
+[Install]
+WantedBy=timers.target
diff --git a/etc/everytea.service b/etc/everytea.service
new file mode 100644
index 0000000..96e8d48
--- /dev/null
+++ b/etc/everytea.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=everytea.ru http server
+After=network.target
+StartLimitIntervalSec=0
+
+[Service]
+Type=simple
+Restart=always
+RestartSec=1
+User=root
+WorkingDirectory=/root/everytea.ru
+ExecStart=/usr/local/bin/luna -n 4 /root/everytea.ru/main.lua /root/everytea.ru/bin/serve.fnl
+
+[Install]
+WantedBy=multi-user.target