mirror of
https://github.com/nextcloud/all-in-one.git
synced 2024-12-29 10:10:55 +08:00
Merge pull request #1622 from nextcloud/enh/1564/add-additional-output
borg - add progress back and add some additional output
This commit is contained in:
commit
1813fc3793
1 changed files with 8 additions and 2 deletions
|
@ -127,7 +127,7 @@ if [ "$BORG_MODE" = backup ]; then
|
|||
# Borg options
|
||||
# auto,zstd compression seems to has the best ratio based on:
|
||||
# https://forum.level1techs.com/t/optimal-compression-for-borg-backups/145870/6
|
||||
BORG_OPTS=(--stats --compression "auto,zstd" --exclude-caches --checkpoint-interval 86400)
|
||||
BORG_OPTS=(--progress --stats --compression "auto,zstd" --exclude-caches --checkpoint-interval 86400)
|
||||
|
||||
# Create the backup
|
||||
echo "Starting the backup..."
|
||||
|
@ -174,16 +174,19 @@ if [ "$BORG_MODE" = backup ]; then
|
|||
exit 1
|
||||
fi
|
||||
done
|
||||
echo "Starting the backup for additional volumes..."
|
||||
if ! borg create "${BORG_OPTS[@]}" "$BORG_BACKUP_DIRECTORY::$CURRENT_DATE-additional-docker-volumes" "/docker_volumes/"; then
|
||||
echo "Deleting the failed backup archive..."
|
||||
borg delete --stats "$BORG_BACKUP_DIRECTORY::$CURRENT_DATE-additional-docker-volumes"
|
||||
echo "Backup of additional docker-volumes failed!"
|
||||
exit 1
|
||||
fi
|
||||
echo "Pruning additional volumes..."
|
||||
if ! borg prune --prefix '*_*-additional-docker-volumes' "${BORG_PRUNE_OPTS[@]}"; then
|
||||
echo "Failed to prune additional docker-volumes archives!"
|
||||
exit 1
|
||||
fi
|
||||
echo "Compacting additional volumes..."
|
||||
if ! borg compact "$BORG_BACKUP_DIRECTORY"; then
|
||||
echo "Failed to compact archives!"
|
||||
exit 1
|
||||
|
@ -201,16 +204,19 @@ if [ "$BORG_MODE" = backup ]; then
|
|||
do
|
||||
EXCLUDE_DIRS+=(--exclude "/host_mounts/$directory/")
|
||||
done
|
||||
echo "Starting the backup for additional host mounts..."
|
||||
if ! borg create "${BORG_OPTS[@]}" "${EXCLUDE_DIRS[@]}" "$BORG_BACKUP_DIRECTORY::$CURRENT_DATE-additional-host-mounts" "/host_mounts/"; then
|
||||
echo "Deleting the failed backup archive..."
|
||||
borg delete --stats "$BORG_BACKUP_DIRECTORY::$CURRENT_DATE-additional-host-mounts"
|
||||
echo "Backup of additional host-mounts failed!"
|
||||
exit 1
|
||||
fi
|
||||
echo "Pruning additional host mounts..."
|
||||
if ! borg prune --prefix '*_*-additional-host-mounts' "${BORG_PRUNE_OPTS[@]}"; then
|
||||
echo "Failed to prune additional host-mount archives!"
|
||||
exit 1
|
||||
fi
|
||||
echo "Compacting additional host mounts..."
|
||||
if ! borg compact "$BORG_BACKUP_DIRECTORY"; then
|
||||
echo "Failed to compact archives!"
|
||||
exit 1
|
||||
|
@ -347,7 +353,7 @@ if [ "$BORG_MODE" = check ]; then
|
|||
echo "Checking the backup integrity..."
|
||||
|
||||
# Perform the check
|
||||
if ! borg check --verify-data "$BORG_BACKUP_DIRECTORY"; then
|
||||
if ! borg check --progress --verify-data "$BORG_BACKUP_DIRECTORY"; then
|
||||
echo "Some errors were found while checking the backup integrity!"
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue