update restic
This commit is contained in:
@@ -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}
|
||||||
@@ -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
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=restic backup
|
Description=restic Backup Trigger
|
||||||
|
Documentation=man:restic(1)
|
||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
Persistent=true
|
Persistent=true
|
||||||
|
|||||||
Reference in New Issue
Block a user