From 5e52dc3ad8f683232430ff9d550092fa93259c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Sch=C3=A4ferdiek?= Date: Tue, 23 Nov 2021 22:25:05 +0100 Subject: [PATCH] Add borgmatic check also as user file --- etc/systemd/system/borgmatic-check@.timer | 4 ++-- etc/systemd/user/borgmatic-check@.service | 15 +++++++++++++++ etc/systemd/user/borgmatic-check@.timer | 9 +++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 etc/systemd/user/borgmatic-check@.service create mode 100644 etc/systemd/user/borgmatic-check@.timer diff --git a/etc/systemd/system/borgmatic-check@.timer b/etc/systemd/system/borgmatic-check@.timer index e8e08b8..99a29ef 100644 --- a/etc/systemd/system/borgmatic-check@.timer +++ b/etc/systemd/system/borgmatic-check@.timer @@ -2,8 +2,8 @@ Description=Run borgmatic check %I backup timer utilizing HOME/.config/borgmatic/%I.yml file [Timer] -OnCalendar=*-*-* 20:00:00 -Persistent=false +OnCalendar=Mon,Thu 22:00:00 +Persistent=true [Install] WantedBy=timers.target diff --git a/etc/systemd/user/borgmatic-check@.service b/etc/systemd/user/borgmatic-check@.service new file mode 100644 index 0000000..70f2408 --- /dev/null +++ b/etc/systemd/user/borgmatic-check@.service @@ -0,0 +1,15 @@ +[Unit] +Description=Run borgmatic backup check 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 check --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-check@.timer b/etc/systemd/user/borgmatic-check@.timer new file mode 100644 index 0000000..99a29ef --- /dev/null +++ b/etc/systemd/user/borgmatic-check@.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Run borgmatic check %I backup timer utilizing HOME/.config/borgmatic/%I.yml file + +[Timer] +OnCalendar=Mon,Thu 22:00:00 +Persistent=true + +[Install] +WantedBy=timers.target