]> git.p6c8.net - nextcloud-backup-restore.git/blobdiff - NextcloudBackup.sh
Merge pull request #7 from timkrief/mainBackupDir-Fix
[nextcloud-backup-restore.git] / NextcloudBackup.sh
index 38de99584c1965757cfe73d361d5def1e22ae134..dae6e7faf489533826c9573910186791254602d7 100644 (file)
@@ -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

patrick-canterino.de