mirror of
https://github.com/YunoHost-Apps/borg_ynh.git
synced 2024-09-03 18:16:05 +02:00
Merge 1ec5222f3a
into ba706bdb61
This commit is contained in:
commit
f1ebba6e26
1 changed files with 14 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue