Skip to content
Snippets Groups Projects
Commit b37edd26 authored by Guillaume Subiron's avatar Guillaume Subiron
Browse files

borg: run borg compact after borg prune when borg version > 1.2

parent 1cc50d05
No related branches found
No related tags found
1 merge request!69Multiple improvements in borg handler
......@@ -265,6 +265,21 @@ if [ "$prune" == "yes" ]; then
if [ $ret = 0 ]; then
debug "$output"
info "Removing old backups succeeded."
if [[ "$(borg --version)" > "borg 1.2" ]] ; then
compactstr="borg compact $execstr_repository"
debug "$compactstr"
output="$(su -c "$compactstr" 2>&1)"
ret=$?
if [ $ret = 0 ]; then
debug "$output"
info "Compacting borg repository succeeded."
else
info "$output"
warning "Compacting borg repository failed. Borg returned exit code ${ret}."
fi
fi
elif [ $ret = 1 ]; then
warning "$output"
warning "Removing old backups finished with warnings."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment