1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/borg_ynh.git synced 2024-09-03 18:16:05 +02:00

Fix "Borg fails when file changes on disk during archive creation"

This commit is contained in:
Florent 2024-08-25 15:33:33 +02:00 committed by Florent F
parent f8e9155df3
commit 1ec5222f3a

View file

@ -46,7 +46,20 @@ This is an automated message from your beloved YunoHost server." | /usr/bin/mail
# About the {now} placeholder:
# https://borgbackup.readthedocs.io/en/stable/usage/create.html#description
# In the archive name, you may use the following placeholders: {now}, {utcnow}, {fqdn}, {hostname}, {user} and some others.
"$borg" create --stats "::${name}-{now}" "$work_dir"
"$borg" create --stats "::${name}-{now}" "$work_dir" || status=$?
# Check whether the above command exit with a return code > 0
case "$status" in
"") # return code was 0, skip
;;
"1")
# This is a warning, the script may continue, but let's warn the admin.
# See: https://github.com/borgbackup/borg/issues/6989#issuecomment-1223921392
echo "Some warning were logged during the backup, you'd probably check whether it was severe or not" >&2
;;
*)
exit $status
;;
esac
"$borg" prune --glob-archives "${name}-*" --list --keep-hourly 2 --keep-daily=7 --keep-weekly=8 --keep-monthly=12