Created
August 4, 2014 19:33
-
-
Save tlongren/0e04f8efbc88ff793b51 to your computer and use it in GitHub Desktop.
Backup and Compress All Databases On Your MySQL Server - More Disk I/O Friendly
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/bash | |
TS=$(date "+%Y%m%d-%H%M%S") | |
SNAP=zpool/mysql@${TS} | |
zfs snapshot $SNAP | |
zfs send $SNAP | pv | xz -z | ssh somewhere "cat > /mnt/snapshots/mysql-${TS}.xz" | |
zfs destroy -Rv $SNAP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From the author:
This sssumes that your /var/lib/mysql is zpool/mysql ofc