From 1abd854ea647a35ce4b09236ea3bd60ba9f33e60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Sch=C3=A4ferdiek?= Date: Mon, 22 Mar 2021 20:42:46 +0100 Subject: [PATCH] Add timer and service for borgmatic utilizing $HOME/.config/borgmatic/%I.yml --- etc/systemd/user/borgmatic@.service | 15 +++++++++++++++ etc/systemd/user/borgmatic@.timer | 9 +++++++++ 2 files changed, 24 insertions(+) create mode 100644 etc/systemd/user/borgmatic@.service create mode 100644 etc/systemd/user/borgmatic@.timer diff --git a/etc/systemd/user/borgmatic@.service b/etc/systemd/user/borgmatic@.service new file mode 100644 index 0000000..32ef46a --- /dev/null +++ b/etc/systemd/user/borgmatic@.service @@ -0,0 +1,15 @@ +[Unit] +Description=Run borgmatic backup for %I utilizing HOME/.config/borgmatic/%I.yml file +OnFailure=systemd_failure_notify@%n.service +Wants=network-online.target +After=network-online.target +ConditionACPower=true + +[Service] +Type=oneshot +ExecStart=borgmatic --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml +Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin" +Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" + +[Install] +WantedBy=multi-user.target diff --git a/etc/systemd/user/borgmatic@.timer b/etc/systemd/user/borgmatic@.timer new file mode 100644 index 0000000..57d06c4 --- /dev/null +++ b/etc/systemd/user/borgmatic@.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Run borgmatic %I backup timer utilizing HOME/.config/borgmatic/%I.yml file + +[Timer] +OnCalendar=*-*-* 20:00:00 +Persistent=false + +[Install] +WantedBy=timers.target