Forked from etagwerker/incremental-backups-percona-xtrabackup.sh
Created
July 9, 2016 11:53
-
-
Save RusAlex/b2e3ad42d5d62e5c04e0d715728936ab to your computer and use it in GitHub Desktop.
Bash script to perform MySQL incremental backups with Percona xtrabackup with Cron, starting with a full backup.
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
STAMP=`date +%Y%m%d%H%M` | |
echo "Iniciando backup @ $STAMP" | |
mkdir -p /var/backups/$STAMP | |
LAST_DIR=`ls /var/backups/inc | sort -n | tail -1` | |
xtrabackup --use-memory=1G --backup --target-dir=/var/backups/inc/$STAMP --incremental-basedir=/var/backups/inc/$LAST_DIR --user=root --password=<root-password> | |
echo "Fin backup @ $STAMP" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment