-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
+