#!/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)