Skip to content

Instantly share code, notes, and snippets.

@alastairbattrick
alastairbattrick / run-xtrabackup.sh
Last active February 9, 2024 10:11 — forked from jmfederico/run-xtrabackup.sh
Script to create full/incremental backups with xtrabackup.
#!/bin/sh
# Thank you to https://gist.github.com/jmfederico/1495347
TMPFILE="/tmp/xtrabackup-runner.$$.tmp"
PASSWORDFILE="/opt/backup/secret.conf"
USEROPTIONS="--defaults-extra-file=$PASSWORDFILE --user=${MYSQL_USER} --host=${MYSQL_HOST}"
COMPRESSOPTION="--compress"
BACKDIR=/backup
BASEBACKDIR=$BACKDIR/base