Add dry-run support for delete-checkpoints
parent
04fdf1f192
commit
740621b4e4
|
|
@ -97,11 +97,17 @@ borg_verify () {
|
||||||
}
|
}
|
||||||
|
|
||||||
borg_delete_checkpoints () {
|
borg_delete_checkpoints () {
|
||||||
|
local DELETE_ARGS=()
|
||||||
|
|
||||||
|
if ${DRY_RUN}; then
|
||||||
|
DELETE_ARGS+=( --dry-run )
|
||||||
|
fi
|
||||||
|
|
||||||
${BORG} list "${BORG_REPO}" \
|
${BORG} list "${BORG_REPO}" \
|
||||||
| { grep .checkpoint || true; } \
|
| { grep .checkpoint || true; } \
|
||||||
| cut -d ' ' -f 1 \
|
| cut -d ' ' -f 1 \
|
||||||
| xargs -I % -n 1 --no-run-if-empty \
|
| xargs -I % -n 1 --no-run-if-empty \
|
||||||
${BORG} delete "${BORG_REPO}"::%
|
${BORG} delete "${DELETE_ARGS[@]}" "${BORG_REPO}"::%
|
||||||
}
|
}
|
||||||
|
|
||||||
borg_exec () {
|
borg_exec () {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue