Created
July 21, 2013 14:36
-
-
Save jimrybarski/6048741 to your computer and use it in GitHub Desktop.
One liner to dump MySQL database and compress on the fly
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
# standard way | |
mysqldump my_db -u root -p | gzip -c | cat > my_db.sql.gz | |
# append a timestamp to the filename | |
mysqldump my_db -u root -p | gzip -c | cat > my_db-$(date +%Y-%m-%d-%H.%M.%S).sql.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment