Comment 2 for bug 1010621

Revision history for this message
Patrick Crews (patrick-crews) wrote :

Here is a script I wrote that can backup a mysql database via innobackupex and upload it to a specified swift container.
It assumes there is a pw file and that the swift container already exists...might be useful for this

python backup_and_store_directory.py --os_username=USER --os_password=PASSWORD --os_tenant_name=USER-tenant1 --swift_store_name='mahtester' --backup_name='db_backup_stage' --pass_file=pw_file.dat --db_backup_path=/var/lib/mysql/ --os_auth_url=https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens

Creating encrypted backup up MySQL database via innobackupex...
Backup name: db_backup_stage-20130423-21-27-05.tar.gz.des3
Command: innobackupex --stream=tar /var/lib/mysql/ | gzip - | openssl des3 -salt -kfile pw_file.dat > db_backup_stage-20130423-21-27-05.tar.gz.des3
Status: 0
Output:

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Ireland Ltd 2009-2012. All Rights Reserved.

innobackupex: Backup created in directory '/var/lib/mysql'
innobackupex: MySQL binlog position: filename '', position
innobackupex: You must use -i (--ignore-zeros) option for extraction of the tar stream.
130423 21:27:29 innobackupex: completed OK!
Swift store result:

201
--------------------------------------------------------------------------------
Listing all objects in store...
db_backup_stage-20130423-21-27-05.tar.gz.des3

Removing backup file: db_backup_stage-20130423-21-27-05.tar.gz.des3