-echo "Creating backup of Nextcloud data directory..."
-tar -cpzf "${backupdir}/${fileNameBackupDataDir}" -C "${nextcloudDataDir}" .
+echo "$(date +"%H:%M:%S"): Creating backup of Nextcloud data directory..."
+
+if [ "$ignoreUpdaterBackups" = true ] ; then
+ echo "Ignoring updater backup directory"
+
+ if [ "$useCompression" = true ] ; then
+ `$compressionCommand "${backupDir}/${fileNameBackupDataDir}" --exclude="updater-*/backups/*" -C "${nextcloudDataDir}" .`
+ else
+ tar -cpf "${backupDir}/${fileNameBackupDataDir}" --exclude="updater-*/backups/*" -C "${nextcloudDataDir}" .
+ fi
+else
+ if [ "$useCompression" = true ] ; then
+ `$compressionCommand "${backupDir}/${fileNameBackupDataDir}" -C "${nextcloudDataDir}" .`
+ else
+ tar -cpf "${backupDir}/${fileNameBackupDataDir}" -C "${nextcloudDataDir}" .
+ fi
+fi
+