-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
+ tar -I pigz -cpf "${backupdir}/${fileNameBackupDataDir}" --exclude="updater-*/backups/*" -C "${nextcloudDataDir}" .
+ else
+ tar -cpf "${backupdir}/${fileNameBackupDataDir}" --exclude="updater-*/backups/*" -C "${nextcloudDataDir}" .
+ fi
+else
+ if [ "$useCompression" = true ] ; then
+ tar -I pigz -cpf "${backupdir}/${fileNameBackupDataDir}" -C "${nextcloudDataDir}" .
+ else
+ tar -cpf "${backupdir}/${fileNameBackupDataDir}" -C "${nextcloudDataDir}" .
+ fi
+fi
+