Created
June 30, 2015 11:44
-
-
Save Deimosster/258d67cb65e3e6c0f0e8 to your computer and use it in GitHub Desktop.
Percona xtrabackup script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| from datetime import datetime | |
| import os | |
| # set date parameter | |
| today = datetime.now().strftime('%Y-%m-%d-%H-%M-%S') | |
| # get systemname | |
| systemname=os.uname()[1] | |
| # set create archive command | |
| exportcommand1='innobackupex --defaults-file=/etc/my.cnf --no-timestamp /mnt/backup/xtrabackup/'+systemname+'-'+today | |
| exportcommand2='innobackupex --apply-log /mnt/backup/xtrabackup/'+systemname+'-'+today | |
| os.system(exportcommand1) | |
| os.system(exportcommand2) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment