Hi,
I re-wrote a little the script I am using to backup export management server database and configuration and upload it to a remote FTP server.
I know few people here are using it so attached is probably better version of what it was.
You need to configure some variables in CONFIG section in the beginning.
Also, you need to make sure no GUI clients are connected currently to management server or cpstop, backup and then cpstart.
02-Mar-19: Attached new version that will now check and fail (can be configured to continue) if GUI client is connected.