update restic

This commit is contained in:
2021-08-31 11:03:48 +02:00
parent d84e5a3172
commit 1790f6719b
3 changed files with 16 additions and 8 deletions

View File

@@ -46,7 +46,16 @@ if [[ $1 == 'prune' ]]; then
info "Pruning snapshots..." info "Pruning snapshots..."
$HOME/.local/bin/restic --cache-dir ${CACHE_DIR} -r ${RESTIC_REPOSITORY} prune --max-unused 0 $HOME/.local/bin/restic --cache-dir ${CACHE_DIR} -r ${RESTIC_REPOSITORY} prune --max-unused 0
info "Done" info "Done"
info "Checking repository..."
$HOME/.local/bin/restic -r ${RESTIC_REPOSITORY} check
info "Done"
else else
if ! eval which snapper 2> /dev/null; then
# fallback
BACKUP_PATHS="/home/flexo"
fi
info "Starting backup..." info "Starting backup..."
$HOME/.local/bin/restic --cache-dir ${CACHE_DIR} -r ${RESTIC_REPOSITORY} backup ${BACKUP_PATHS} \ $HOME/.local/bin/restic --cache-dir ${CACHE_DIR} -r ${RESTIC_REPOSITORY} backup ${BACKUP_PATHS} \
--exclude-file ${EXCLUDES_FILE} --exclude-file ${EXCLUDES_FILE}

View File

@@ -1,10 +1,8 @@
[Unit] [Unit]
Description=restic backup Description=restic Backup
Documentation=man:restic(1)
[Service] [Service]
Type=oneshot Type=simple
ExecStartPre=/usr/bin/nm-online -q ExecStartPre=/bin/sh -c 'until ping -c1 google.com; do sleep 1; done;'
ExecStart=%h/.bin/restic-backup ExecStart=%h/.dotfiles/bin/restic-backup
[Install]
WantedBy=multi-user.target

View File

@@ -1,5 +1,6 @@
[Unit] [Unit]
Description=restic backup Description=restic Backup Trigger
Documentation=man:restic(1)
[Timer] [Timer]
Persistent=true Persistent=true