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 .
You are required to install python on your machine, also install MySQLdb module for python.
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
Change:
sqlHost = 'localhost';
sqlUser = 'username';
sqlPsw = 'password';
path = "/var/www";
with your settings.
Save the file and you are done!
In the terminal type:
./osb_backup.py