From 512bf8e5a4098c02029257cb633637184fca3730 Mon Sep 17 00:00:00 2001 From: deajan Date: Sun, 30 Sep 2018 17:18:09 +0200 Subject: [PATCH] Rebuilt targets --- dev/debug_obackup.sh | 13 +++++++++---- obackup.sh | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/dev/debug_obackup.sh b/dev/debug_obackup.sh index e19dad0..9b93041 100755 --- a/dev/debug_obackup.sh +++ b/dev/debug_obackup.sh @@ -7,7 +7,7 @@ PROGRAM="obackup" AUTHOR="(C) 2013-2018 by Orsiris de Jong" CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr" PROGRAM_VERSION=2.1-RC1 -PROGRAM_BUILD=2018093006 +PROGRAM_BUILD=2018093008 IS_STABLE=no #### Execution order #__WITH_PARANOIA_DEBUG @@ -4544,6 +4544,11 @@ function RemoteLogger { } function _RotateBackupsRemoteSSH { + local backup + local copy + local cmd + local path + $REMOTE_FIND_CMD "$backupPath" -mindepth 1 -maxdepth 1 ! -regex ".*\.$PROGRAM\.[0-9]+" -print0 | while IFS= read -r -d $'\0' backup; do copy=$rotateCopies while [ $copy -gt 1 ]; do @@ -4570,7 +4575,7 @@ function _RotateBackupsRemoteSSH { fi fi - copy=$((opy-1)) + copy=$((copy-1)) done # Latest file backup will not be moved if script configured for remote backup so next rsync execution will only do delta copy instead of full one @@ -4628,11 +4633,11 @@ function RotateBackups { __CheckArguments 2 $# "$@" #__WITH_PARANOIA_DEBUG - Logger "Rotating backups in [$backupPath] for [$rotateCopies] copies." "NOTICE" - if [ "$BACKUP_TYPE" == "local" ] || [ "$BACKUP_TYPE" == "pull" ]; then + Logger "Rotating local backups in [$backupPath] for [$rotateCopies] copies." "NOTICE" _RotateBackupsLocal "$backupPath" "$rotateCopies" elif [ "$BACKUP_TYPE" == "push" ]; then + Logger "Rotating remote backups in [$backupPath] for [$rotateCopies] copies." "NOTICE" _RotateBackupsRemote "$backupPath" "$rotateCopies" fi } diff --git a/obackup.sh b/obackup.sh index faeed3f..72f74da 100755 --- a/obackup.sh +++ b/obackup.sh @@ -7,7 +7,7 @@ PROGRAM="obackup" AUTHOR="(C) 2013-2018 by Orsiris de Jong" CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr" PROGRAM_VERSION=2.1-RC1 -PROGRAM_BUILD=2018093006 +PROGRAM_BUILD=2018093008 IS_STABLE=no @@ -4324,6 +4324,11 @@ function RemoteLogger { } function _RotateBackupsRemoteSSH { + local backup + local copy + local cmd + local path + $REMOTE_FIND_CMD "$backupPath" -mindepth 1 -maxdepth 1 ! -regex ".*\.$PROGRAM\.[0-9]+" -print0 | while IFS= read -r -d $'\0' backup; do copy=$rotateCopies while [ $copy -gt 1 ]; do @@ -4350,7 +4355,7 @@ function _RotateBackupsRemoteSSH { fi fi - copy=$((opy-1)) + copy=$((copy-1)) done # Latest file backup will not be moved if script configured for remote backup so next rsync execution will only do delta copy instead of full one @@ -4407,11 +4412,11 @@ function RotateBackups { local rotateCopies="${2}" - Logger "Rotating backups in [$backupPath] for [$rotateCopies] copies." "NOTICE" - if [ "$BACKUP_TYPE" == "local" ] || [ "$BACKUP_TYPE" == "pull" ]; then + Logger "Rotating local backups in [$backupPath] for [$rotateCopies] copies." "NOTICE" _RotateBackupsLocal "$backupPath" "$rotateCopies" elif [ "$BACKUP_TYPE" == "push" ]; then + Logger "Rotating remote backups in [$backupPath] for [$rotateCopies] copies." "NOTICE" _RotateBackupsRemote "$backupPath" "$rotateCopies" fi }