Last active
July 25, 2022 13:12
-
-
Save rsperl/83725a1795ede0d470b8bd43f9a74d70 to your computer and use it in GitHub Desktop.
backup mysql #snippet
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
#!/usr/bin/env bash | |
login_path="$1" | |
database_name="$2" | |
dir="$HOME/.mysql_backups" | |
/usr/local/bin/mysqldump --login-path="$login_path" "$database_name" | gzip > "$dir/$database_name-$(/bin/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