Backup MySQL Database to FTP Server
As a server administrator, you must back up the data on a regular basis. Backups are extremely useful for recovering data in the event of a crash or corruption. I created a quick script to create database backups from MySQL and upload them to an FTP server.
As a system administrator, I suggest that you maintain a remote copy of each backup. You may also use our new advanced script to backup and export MySQL databases to remote locations.
Copy the script below into a shell script file. Then execute after updating all of the necessary values.
Setup Details – Change the following variable in the above script to match your device setting. To make the script work, make sure all of the values are right.
- LOCAL_BACKUP_DIR => Local Direction Path For Storing Backups
- DB_NAME => Name Of Database
- DB_USER => Name Of Database Administrator
- DB_PASSWORD => Password For Database Administrator
- FTP_SERVER => Hostname’s FTP Server Ip
- FTP_USERNAME => Username For FTP
- FTP_PASSWORD => Password For FTP
- FTP_UPLOAD_DIR => Backup Path for FTP Server
- LOG_FILE => Name And Location Of The Log File
I hope this script will aid you in backing up your database to an FTP server.
Saad Shafqat
Related posts
New Articles
Fix BlueBubbles Socket Connection Error: Easy Troubleshooting
BlueBubbles enables Android users to use iMessage, creating a bridge between Apple’s messaging system and non-Apple devices. However, users may…