Split create, check and prune borgmatic systemd files

This commit is contained in:
Alexander Schäferdiek 2021-12-22 14:51:15 +01:00
parent 59013f4adf
commit 2bd1d69f1d
12 changed files with 102 additions and 6 deletions

View file

@ -1,5 +1,5 @@
[Unit] [Unit]
Description=Run borgmatic backup check for %I utilizing HOME/.config/borgmatic/%I.yml file Description=Run borgmatic check for %I utilizing HOME/.config/borgmatic/%I.yml file
OnFailure=systemd_failure_notify@%n.service OnFailure=systemd_failure_notify@%n.service
Wants=network-online.target Wants=network-online.target
After=network-online.target After=network-online.target

View file

@ -1,8 +1,8 @@
[Unit] [Unit]
Description=Run borgmatic check %I backup timer utilizing HOME/.config/borgmatic/%I.yml file Description=Run borgmatic %I check timer utilizing HOME/.config/borgmatic/%I.yml file
[Timer] [Timer]
OnCalendar=Mon,Thu 22:00:00 OnCalendar=Wed 21:30:00
Persistent=true Persistent=true
[Install] [Install]

View file

@ -0,0 +1,15 @@
[Unit]
Description=Run borgmatic create 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 create --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

View file

@ -0,0 +1,9 @@
[Unit]
Description=Run borgmatic %I create timer utilizing HOME/.config/borgmatic/%I.yml file
[Timer]
OnCalendar=*-*-* 20:00:00
Persistent=false
[Install]
WantedBy=timers.target

View file

@ -0,0 +1,15 @@
[Unit]
Description=Run borgmatic prune 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 prune --only repository --only archives --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

View file

@ -0,0 +1,9 @@
[Unit]
Description=Run borgmatic %I prune timer utilizing HOME/.config/borgmatic/%I.yml file
[Timer]
OnCalendar=Wed 23:00:00
Persistent=true
[Install]
WantedBy=timers.target

View file

@ -1,5 +1,5 @@
[Unit] [Unit]
Description=Run borgmatic backup check for %I utilizing HOME/.config/borgmatic/%I.yml file Description=Run borgmatic check for %I utilizing HOME/.config/borgmatic/%I.yml file
OnFailure=systemd_failure_notify@%n.service OnFailure=systemd_failure_notify@%n.service
Wants=network-online.target Wants=network-online.target
After=network-online.target After=network-online.target

View file

@ -1,8 +1,8 @@
[Unit] [Unit]
Description=Run borgmatic check %I backup timer utilizing HOME/.config/borgmatic/%I.yml file Description=Run borgmatic %I check timer utilizing HOME/.config/borgmatic/%I.yml file
[Timer] [Timer]
OnCalendar=Mon,Thu 22:00:00 OnCalendar=Wed 21:30:00
Persistent=true Persistent=true
[Install] [Install]

View file

@ -0,0 +1,15 @@
[Unit]
Description=Run borgmatic create 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 create --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

View file

@ -0,0 +1,9 @@
[Unit]
Description=Run borgmatic %I create timer utilizing HOME/.config/borgmatic/%I.yml file
[Timer]
OnCalendar=*-*-* 20:00:00
Persistent=false
[Install]
WantedBy=timers.target

View file

@ -0,0 +1,15 @@
[Unit]
Description=Run borgmatic prune 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 prune --only repository --only archives --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

View file

@ -0,0 +1,9 @@
[Unit]
Description=Run borgmatic %I prune timer utilizing HOME/.config/borgmatic/%I.yml file
[Timer]
OnCalendar=Wed 23:00:00
Persistent=true
[Install]
WantedBy=timers.target