X-Git-Url: https://git.p6c8.net/nextcloud-backup-restore.git/blobdiff_plain/374a1bc67f0cd848e46bf3cb685c9c7fa880f762..2276c3c8aeec9a4a7ae288a3ee99a4123198575d:/NextcloudBackup.sh diff --git a/NextcloudBackup.sh b/NextcloudBackup.sh index 38de995..dae6e7f 100644 --- a/NextcloudBackup.sh +++ b/NextcloudBackup.sh @@ -126,11 +126,11 @@ echo # # Delete old backups # -if [ ${maxNrOfBackups} != 0 ] +if (( ${maxNrOfBackups} != 0 )) then nrOfBackups=$(ls -l ${backupMainDir} | grep -c ^d) - if [ ${maxNrOfBackups} > ${nrOfBackups} ] + if (( ${nrOfBackups} > ${maxNrOfBackups} )) then echo "Removing old backups..." ls -t ${backupMainDir} | tail -$(( nrOfBackups - maxNrOfBackups )) | while read dirToRemove; do