-
Notifications
You must be signed in to change notification settings - Fork 1
Mysql Backup
Darwin Correa edited this page Apr 2, 2016
·
1 revision
Please see example included in autobackup-dcm π¦
Script file: mysql_backup.py
Config File: mysql_config.json
[
{
"cfg": {
"local_backup_dir": "../backup_test_files/jom_backups/",
"remote_backup_dir": "google_folder_id",
"google_credentials_name": "jom_google_credentials.json",
"app_name": "jom",
"google_authorized": false
},
"bk": {
"last_week": 13,
"last_year": 2016,
"last_day": 2,
"last_month": 4
},
"rotate": {
"local": {
"monthly": 12,
"yearly": 2,
"weekly": 4,
"daily": 7
},
"remote": {
"monthly": 12,
"yearly": 3,
"weekly": 4,
"daily": 7
},
"include_list": [],
"exclude_list": [],
"dry_run": false,
"ionice": "idle",
},
"custom": {
"db_user": "jom",
"db_name": "jom",
"db_host": "localhost",
"db_password": "jom"
}
},
{}
]| Key | Type | Mandatory | Description |
|---|---|---|---|
| custom | JSON Object | π | Mysql configuration of app |
| db_user | String | π | Mysql User with full acces to database |
| db_name | String | π | Mysql Database name to backup |
| db_host | String | π | Host of Mysql (Localhost, Name, or IP) |
| db_password | String | π | Password of User Database |
If you not want store password, you should go to official Mysql documentation to mysqldump without password and modify script to support it
You are free of modified the mysql_backup.py script to adapt to your needs.
π The
mysql_backup.pyscript is well documented. (maybe) π©