Nice touch about the credentials, the way I did it in my scripts is not recommended, security-wise.
I noticed a couple of things:
1. In your first script for backing up the database, you've set the backup folder as:
BACKUP_DIR="/home/backup"
Currently, the script immediately transfers the...