Created
January 12, 2022 07:35
-
-
Save AndreasGrip/4330ad4efb7fdfc5be57c35cd833209a to your computer and use it in GitHub Desktop.
Dump/backup mysql database.
This file contains hidden or 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 | |
#"password" should be replaced with your password | |
#"database1" and "database2" should be replaced with the names of your databases. | |
TIMESTAMP=$(date +%Y-%m-%d_%H%M%S) | |
mysqldump -u root -ppassword database1 | gzip > database1_$TIMESTAMP.dump.sql.gz | |
mysqldump -u root -ppassword database2 | gzip > database2_$TIMESTAMP.dump.sql.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment