MySQL backup tool for Elkarbackup
Explanation
- Elkarbackup server runs
MySQLBackup-RemoteTrigger.shbefore starting the backup to login to the target (MySQL) server to runMySQLBackup-Tool.shwith the PRE argument.
This will ask remote mysql to dump all databases to a SQL file to the local temporary backup location (default: /tmp/mysqlBCK) - Elkarbackup will store the temporary backup location
- Elkarbackup server runs
MySQLBackup-RemoteTrigger.shafter running the backup to login to the target (MySQL) server to runMySQLBackup-Tool.shwith the POST argument.
This will ask the remote to clean the temporary backup location
Setup
Steps on MySQL Server
- Make sure SSH server is running
- Add the SSH public key from root@elkarbackupServer and elkarbackupAPP(Downloaded from cogwheel/settings icon > Manage parameters)
- Create a Mysql user with the following Global privilleges:
SELECT, PROCESS, SHOW DATABASES, LOCK TABLES, TRIGGER, SHOW VIEW
be carefull with special charactes in the password - Save
MySQLBackup-Tool.shto/opt/Elkar-MysqlBackup.sh - Update the variables in
/opt/Elkar-MysqlBackup.shto the newly created user
Steps Elkarbackup WebUI
- Under
scripttab add theMySQLBackup-RemoteTrigger.shwithRun asoption Before and After Job - Under
Jobstab add the MySQL server as Client - Under
Jobstab> + on the mysql client to add job - Set Path to the temporary backup location (default: /tmp/mysqlBCK)
Pre and Post sctipt to the just created
script