Last active
February 28, 2018 22:15
-
-
Save n1mh/ed4773298cd79d33e14d33218b35d1e5 to your computer and use it in GitHub Desktop.
mysql/mariadb complete backup
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 | |
OUT="`date +%Y%m%d%H%M%S`-backup-`hostname -f`.sql" | |
mysqldump -u root -p \ | |
--all-databases \ | |
--routines \ | |
--events \ | |
--triggers \ | |
--single-transaction \ | |
--result-file=$OUT | |
bzip2 $OUT | |
echo "complete backup has been generated in $OUT.bz2 file" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment