Add nm-unmetered-connection checks
This commit is contained in:
7
etc/systemd/system/nm-unmetered-connection.service
Normal file
7
etc/systemd/system/nm-unmetered-connection.service
Normal file
@@ -0,0 +1,7 @@
|
||||
[Unit]
|
||||
Description=Check if the current NetworkManager connection is metered
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/local/sbin/nm-unmetered-connection.sh
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
[Unit]
|
||||
Description=Backup with restic to Backblaze B2
|
||||
OnFailure=status-email-user@%n.service
|
||||
Requires=nm-unmetered-connection.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Nice=10
|
||||
ExecStart=/usr/local/sbin/restic_backup.sh
|
||||
# $HOME or $XDG_CACHE_HOME must be set for restic to find /root/.cache/restic/
|
||||
Environment="HOME=/root"
|
||||
Environment="HOME=/root"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
[Unit]
|
||||
Description=Backup with restic on schedule
|
||||
Requires=unmetered-connection.service
|
||||
After=unmetered-connection.service
|
||||
Requires=nm-unmetered-connection.service
|
||||
|
||||
[Timer]
|
||||
OnCalendar=daily
|
||||
|
||||
Reference in New Issue
Block a user