Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tlongren
Created August 4, 2014 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tlongren/0e04f8efbc88ff793b51 to your computer and use it in GitHub Desktop.
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
#!/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
@tlongren
Copy link
Author

tlongren commented Aug 4, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment