]> git.ekhem.eu.org Git - cron.git/commitdiff
Implement a backup service.
authorJakub Czajka <jakub@ekhem.eu.org>
Wed, 29 Nov 2023 23:18:56 +0000 (00:18 +0100)
committerJakub Czajka <jczajka@google.com>
Sun, 24 Dec 2023 18:34:02 +0000 (19:34 +0100)
backup.service [new file with mode: 0644]

diff --git a/backup.service b/backup.service
new file mode 100644 (file)
index 0000000..a3adff8
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 2023 Jakub Czajka <jakub@ekhem.eu.org>
+# License: GPL-3.0 or later.
+
+[Unit]
+Description=Backup files from the system.
+OnFailure=notify_failure@%n.service
+
+[Service]
+Type=oneshot
+ExecStartPre=/usr/bin/git \
+    --work-tree=/tmp \
+    --git-dir=/srv/git/turnup.git \
+    checkout main --force sources.yaml backup.yaml
+ExecStart=/usr/bin/ansible-playbook /tmp/backup.yaml \
+    --connection=local \
+    --extra-vars token=/srv/prod/gdrive_proxy/token.json \
+    --extra-vars key=/srv/prod/gdrive_proxy/private/storage_drive.key \
+    --extra-vars sources=/tmp/sources.yaml