Last active
September 14, 2015 09:33
-
-
Save kudarap/c19a1fbc8e38a4313de3 to your computer and use it in GitHub Desktop.
back up project files & mysql db
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
echo 'backing up ...' | |
# sql dump all | |
mysqldump -v -u dev -p --all-databases > mysql-`date '+%d-%m-%Y'`.sql | |
# project files | |
tar jcvf project-`date '+%d-%m-%Y'`.tar.bz2 /project/ | |
# put all together | |
tar jcvf backup-`date '+%d-%m-%Y'`.tar.bz2 project-* mysql-* | |
# clean | |
rm -v mysql-* project-* | |
# done | |
echo 'back up done!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment