MySQL Database Backup
This script will backup your database and submit it to GitHub, on the assumption that your Github is set over SSH.
The script has been build on python version 2.7.3 .
Dependencies
You are required to install python on your machine, also install MySQLdb module for python.
Structure
When the script will run it will create some folders as follows:
- One folder named backup
- Inside the folder backup it will be create a current day folder ie: 20150605
- Inside the current day folder it will be create a folder with each database which will contain an sql.gzip file
Configure
Open the file osb_backup.py to edit.
Change:
sqlHost = 'localhost';
with your settings.
sqlUser = 'username';
sqlPsw = 'password';
Save the file and you are done!
Run it!
In the terminal type:
./osb_backup.py