aboutsummaryrefslogtreecommitdiff
path: root/gn
diff options
context:
space:
mode:
authorEfraim Flashner2019-11-03 03:28:04 -0600
committerEfraim Flashner2019-11-03 03:28:04 -0600
commit1271add28c5d85b0d1f07e602255990fe8cfc8bf (patch)
treeb4bd916db746e79d8116fbc586f9e4b73e6a9076 /gn
parentc94a2ab00834214c85be6d9221a598aea4ca8cce (diff)
downloadguix-bioinformatics-1271add28c5d85b0d1f07e602255990fe8cfc8bf.tar.gz
gn: Add gitea backup timer
Diffstat (limited to 'gn')
-rw-r--r--gn/services/gitea-dump.service11
-rw-r--r--gn/services/gitea-dump.timer9
2 files changed, 20 insertions, 0 deletions
diff --git a/gn/services/gitea-dump.service b/gn/services/gitea-dump.service
new file mode 100644
index 0000000..b9b310d
--- /dev/null
+++ b/gn/services/gitea-dump.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Backup Gitea git server
+Wants=gitea.service
+
+[Service]
+Type=oneshot
+Environment="GITEA_COMMAND=$(GUIX_PACKAGE_PATH=/home/efraimf/workspace/guix-bioinformatics /var/guix/profiles/per-user/efraimf/current-guix/bin/guix build gitea)/bin/gitea"
+ExecStart=/bin/su -l gitea -c 'GITEA_WORK_DIR=/var/lib/git/gitea HOME=/var/lib/git/gitea ${GITEA_COMMAND} dump'
+
+[Install]
+WantedBy=multi-user.target
diff --git a/gn/services/gitea-dump.timer b/gn/services/gitea-dump.timer
new file mode 100644
index 0000000..0fa0f29
--- /dev/null
+++ b/gn/services/gitea-dump.timer
@@ -0,0 +1,9 @@
+[Unit]
+Description=Backup Gitea git server timer
+
+[Timer]
+OnBootSec=15m
+OnUnitInactiveSec=1day
+
+[Install]
+WantedBy=default.target