From 1790f6719be555c5d5249f43944155ceb6d2c75e Mon Sep 17 00:00:00 2001 From: Marco Date: Tue, 31 Aug 2021 11:03:48 +0200 Subject: [PATCH] update restic --- {restic/.bin => bin}/restic-backup | 9 +++++++++ restic/.config/systemd/user/restic-backup.service | 12 +++++------- restic/.config/systemd/user/restic-backup.timer | 3 ++- 3 files changed, 16 insertions(+), 8 deletions(-) rename {restic/.bin => bin}/restic-backup (89%) diff --git a/restic/.bin/restic-backup b/bin/restic-backup similarity index 89% rename from restic/.bin/restic-backup rename to bin/restic-backup index 61696d4..a30f0cf 100755 --- a/restic/.bin/restic-backup +++ b/bin/restic-backup @@ -46,7 +46,16 @@ if [[ $1 == 'prune' ]]; then info "Pruning snapshots..." $HOME/.local/bin/restic --cache-dir ${CACHE_DIR} -r ${RESTIC_REPOSITORY} prune --max-unused 0 info "Done" + + info "Checking repository..." + $HOME/.local/bin/restic -r ${RESTIC_REPOSITORY} check + info "Done" else + if ! eval which snapper 2> /dev/null; then + # fallback + BACKUP_PATHS="/home/flexo" + fi + info "Starting backup..." $HOME/.local/bin/restic --cache-dir ${CACHE_DIR} -r ${RESTIC_REPOSITORY} backup ${BACKUP_PATHS} \ --exclude-file ${EXCLUDES_FILE} diff --git a/restic/.config/systemd/user/restic-backup.service b/restic/.config/systemd/user/restic-backup.service index a6a22f1..b15bd7b 100644 --- a/restic/.config/systemd/user/restic-backup.service +++ b/restic/.config/systemd/user/restic-backup.service @@ -1,10 +1,8 @@ [Unit] -Description=restic backup +Description=restic Backup +Documentation=man:restic(1) [Service] -Type=oneshot -ExecStartPre=/usr/bin/nm-online -q -ExecStart=%h/.bin/restic-backup - -[Install] -WantedBy=multi-user.target +Type=simple +ExecStartPre=/bin/sh -c 'until ping -c1 google.com; do sleep 1; done;' +ExecStart=%h/.dotfiles/bin/restic-backup diff --git a/restic/.config/systemd/user/restic-backup.timer b/restic/.config/systemd/user/restic-backup.timer index defa16e..cfebebe 100644 --- a/restic/.config/systemd/user/restic-backup.timer +++ b/restic/.config/systemd/user/restic-backup.timer @@ -1,5 +1,6 @@ [Unit] -Description=restic backup +Description=restic Backup Trigger +Documentation=man:restic(1) [Timer] Persistent=true