From 740621b4e4617cf298a346a9b9ba91f7f28051da Mon Sep 17 00:00:00 2001 From: hk Date: Sat, 16 Sep 2017 11:47:14 +0200 Subject: [PATCH] Add dry-run support for delete-checkpoints --- src/borgwrapper.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/borgwrapper.sh b/src/borgwrapper.sh index bfff7bf..8e43e21 100755 --- a/src/borgwrapper.sh +++ b/src/borgwrapper.sh @@ -97,11 +97,17 @@ borg_verify () { } borg_delete_checkpoints () { + local DELETE_ARGS=() + + if ${DRY_RUN}; then + DELETE_ARGS+=( --dry-run ) + fi + ${BORG} list "${BORG_REPO}" \ | { grep .checkpoint || true; } \ | cut -d ' ' -f 1 \ | xargs -I % -n 1 --no-run-if-empty \ - ${BORG} delete "${BORG_REPO}"::% + ${BORG} delete "${DELETE_ARGS[@]}" "${BORG_REPO}"::% } borg_exec () {