From e745242bacdb5721b76c6bad6e7c9c869ad003d9 Mon Sep 17 00:00:00 2001 From: Jakub Czajka Date: Thu, 30 Nov 2023 00:18:56 +0100 Subject: [PATCH] Implement a backup service. --- backup.service | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 backup.service diff --git a/backup.service b/backup.service new file mode 100644 index 0000000..a3adff8 --- /dev/null +++ b/backup.service @@ -0,0 +1,18 @@ +# Copyright (c) 2023 Jakub Czajka +# 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 -- 2.39.5