Combine Nextcloud-Backup-Restore-master and Dropbox-Uploader

I am trying to combine Nextcloud-Backup-Restore-master and Dropbox-Uploader. The backups are stored in Dropbox, so when I want to restore a backup, I should copy the backup from Dropbox to the VPS

At this moment the backup application creates the backup and upload the file to Dropbox. That works well.
The restore application doesn’t work correct.
I will give some lines on my screen which - I think - give some errors:

Updating the system data-fingerprint...
Nextcloud is in maintenance mode - no app have been loaded


Switching off maintenance mode...
Nextcloud is in maintenance mode - no app have been loaded

A part of my modified

# File names for backup files

# Copy backup from Dropbox to Nextcloud server
if [ -d "${currentRestoreDir}" ]
     rm -r ${currentRestoreDir}
# exit 1
/root/Dropbox-Uploader/ download ${restore} ${currentRestoreDir}

# Function for error messages


# In this case the data directory is under the application directory,
# so this directory doesn't exist anymore
# echo "Deleting old Nextcloud data directory..."
# rm -r "${nextcloudDataDir}"
# mkdir -p "${nextcloudDataDir}"
# echo "Done"
# echo


# Update the system data-fingerprint (see
echo "Updating the system data-fingerprint..."
cd "${nextcloudFileDir}"
sudo -u "${webserverUser}" php /var/www/html/occ maintenance:data-fingerprint
cd ~
echo "Done"

# Disable maintenance mode
echo "Switching off maintenance mode..."
cd "${nextcloudFileDir}"
sudo -u "${webserverUser}" php /var/www/html/occ maintenance:mode --off
cd ~
echo "Done"

echo "DONE!"
echo "Backup ${restore} successfully restored."

Can you help me to resolve the problems of the given error messages?

Kind regards,