This file contains 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
# On OSX the PATH variable isn't exported unless "SHELL" is also set, see: http://stackoverflow.com/a/25506676 | |
SHELL = /bin/zsh | |
.DEFAULT_GOAL := help | |
TMPDIR := $(shell mktemp -d) | |
include .env | |
INTRO = "\n\e[33m------------------------------\e[32m\n$@\n\e[33m------------------------------\e[39m\n" | |
help: ## Prints this message |
This file contains 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
#!/bin/sh | |
TMPFILE="/tmp/xtrabackup-runner.$$.tmp" | |
USEROPTIONS="--user=${MYSQL_USER} --password=${MYSQL_PASSWORD} --host=${MYSQL_HOST}" | |
BACKDIR=/srv/mysql-bak | |
BASEBACKDIR=$BACKDIR/base | |
INCRBACKDIR=$BACKDIR/incr | |
FULLBACKUPCYCLE=604800 # Create a new full backup every X seconds | |
KEEP=1 # Number of additional backups cycles a backup should kept for. | |
START=`date +%s` |
This file contains 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
# BackUp | |
mysqldump --opt --password=miclave --user=miuser mibasededatos > archivo.sql | |
# BackUp to bz2 | |
mysqldump --opt --password=miclave --user=miuser mibasededatos | bzip2 -c > archivo.sql.bz2 |