From: DecaTec Date: Fri, 19 Feb 2021 14:57:09 +0000 (+0100) Subject: Optimized cleaning up old backups X-Git-Tag: v2.1.1~3 X-Git-Url: https://git.p6c8.net/nextcloud-backup-restore.git/commitdiff_plain/001bec529747e994540cbace860016591a323e33 Optimized cleaning up old backups --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 029b3f1..e8d2b5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 2.1.1 + +### Backup +- Optimized cleaning up of old backups. + ## 2.1.0 ### General diff --git a/NextcloudBackup.sh b/NextcloudBackup.sh index 5606883..4c735de 100644 --- a/NextcloudBackup.sh +++ b/NextcloudBackup.sh @@ -3,7 +3,7 @@ # # Bash script for creating backups of Nextcloud. # -# Version 2.1.0 +# Version 2.1.1 # # Usage: # - With backup directory specified in the script: ./NextcloudBackup.sh @@ -267,7 +267,7 @@ if [ ${maxNrOfBackups} != 0 ] then nrOfBackups=$(ls -l ${backupMainDir} | grep -c ^d) - if [[ ${nrOfBackups} > ${maxNrOfBackups} ]] + if [ ${nrOfBackups} -gt ${maxNrOfBackups} ] then echo "Removing old backups..." ls -t ${backupMainDir} | tail -$(( nrOfBackups - maxNrOfBackups )) | while read -r dirToRemove; do diff --git a/NextcloudRestore.sh b/NextcloudRestore.sh index 51581be..f12ab49 100644 --- a/NextcloudRestore.sh +++ b/NextcloudRestore.sh @@ -3,7 +3,7 @@ # # Bash script for restoring backups of Nextcloud. # -# Version 2.1.0 +# Version 2.1.1 # # Usage: # - With backup directory specified in the script: ./NextcloudRestore.sh (e.g. ./NextcloudRestore.sh 20170910_132703) diff --git a/setup.sh b/setup.sh index f5f4d1e..3556020 100755 --- a/setup.sh +++ b/setup.sh @@ -3,7 +3,7 @@ # # Bash script an easy setup of NextcloudBackup.sh and NextcloudRestore.sh # -# Version 2.1.0 +# Version 2.1.1 # # Usage: # - call the setup.sh script