diff options
author | Mike Crute <mike@crute.us> | 2020-05-10 01:09:06 +0000 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2020-05-10 01:25:49 +0000 |
commit | c73be7f94bbd1877199074f5f66d7b061b8f77f7 (patch) | |
tree | 0f8ea9a012735741734fa52f0432a5f27b7c93d7 /.linux | |
parent | 309787a43b86b87ffb8e394e54788018def6cad1 (diff) | |
download | dotfiles-c73be7f94bbd1877199074f5f66d7b061b8f77f7.tar.bz2 dotfiles-c73be7f94bbd1877199074f5f66d7b061b8f77f7.tar.xz dotfiles-c73be7f94bbd1877199074f5f66d7b061b8f77f7.zip |
Make backup one-size-fits-all
Diffstat (limited to '.linux')
-rw-r--r-- | .linux/systemd/laptop-backup.timer | 8 | ||||
-rw-r--r-- | .linux/systemd/system-backup.service (renamed from .linux/systemd/laptop-backup.service) | 9 | ||||
-rw-r--r-- | .linux/systemd/system-backup.timer | 10 |
3 files changed, 17 insertions, 10 deletions
diff --git a/.linux/systemd/laptop-backup.timer b/.linux/systemd/laptop-backup.timer deleted file mode 100644 index 008e7f3..0000000 --- a/.linux/systemd/laptop-backup.timer +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | [Unit] | ||
2 | Description=Run laptop backup with restic daily | ||
3 | |||
4 | [Timer] | ||
5 | OnCalendar=*-*-* 00:00:00 | ||
6 | |||
7 | [Install] | ||
8 | WantedBy=default.target | ||
diff --git a/.linux/systemd/laptop-backup.service b/.linux/systemd/system-backup.service index 8fb5119..b4569ab 100644 --- a/.linux/systemd/laptop-backup.service +++ b/.linux/systemd/system-backup.service | |||
@@ -1,11 +1,16 @@ | |||
1 | [Unit] | 1 | [Unit] |
2 | Description=backup laptop with restic | 2 | Description=backup system with restic |
3 | |||
4 | ConditionPathExists=%h/.restic-key | ||
5 | ConditionPathExists=%h/.backup-filter | ||
3 | 6 | ||
4 | [Service] | 7 | [Service] |
5 | Type=oneshot | 8 | Type=oneshot |
9 | |||
10 | ExecCondition=ping -q -c1 -W1 -w1 schroeder.sea1.crute.me | ||
11 | |||
6 | Environment="RESTIC_REPOSITORY=rest:http://schroeder.sea1.crute.me:6275/mcrute-devices" | 12 | Environment="RESTIC_REPOSITORY=rest:http://schroeder.sea1.crute.me:6275/mcrute-devices" |
7 | Environment="RESTIC_PASSWORD_FILE=%h/.restic-key" | 13 | Environment="RESTIC_PASSWORD_FILE=%h/.restic-key" |
8 | ExecCondition=ping -q -c1 -W1 -w1 schroeder.sea1.crute.me | ||
9 | ExecStart=restic backup --exclude-file %h/.backup-filter %h | 14 | ExecStart=restic backup --exclude-file %h/.backup-filter %h |
10 | 15 | ||
11 | [Install] | 16 | [Install] |
diff --git a/.linux/systemd/system-backup.timer b/.linux/systemd/system-backup.timer new file mode 100644 index 0000000..8edddb7 --- /dev/null +++ b/.linux/systemd/system-backup.timer | |||
@@ -0,0 +1,10 @@ | |||
1 | [Unit] | ||
2 | Description=Run system backup with restic daily | ||
3 | |||
4 | [Timer] | ||
5 | OnCalendar=*-*-* 00:00:00 | ||
6 | AccuracySec=8h | ||
7 | RandomizedDelaySec=15m | ||
8 | |||
9 | [Install] | ||
10 | WantedBy=default.target | ||