Created
June 7, 2011 21:50
-
-
Save mallamanis/1013258 to your computer and use it in GitHub Desktop.
Simple MySQL Dump backup
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/bash | |
mysqldump --all-databases --user="username" --password="password" --single-transaction >/destination/folder/all_databases.sql | |
cd /destination/folder/ | |
# Create new archive | |
ARCHIVE_NAME=DBs$(date '+%G%m%d%k').tar | |
tar -cvvf $ARCHIVE_NAME all_databases.sql | |
#delete file | |
rm all_databases.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment