Last active
March 27, 2017 05:06
-
-
Save abdulhadad/92f8358cf2634f62b3ea76424353796c to your computer and use it in GitHub Desktop.
Backup or sanpshot yout apache php application
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
| [client] | |
| password=your_pass |
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 | |
| # backup lamp application on ubuntu | |
| DATE=$(date +%Y%m%d-%H%M) | |
| APP=app_name | |
| DIRS="dir1 dir2" | |
| DBS="db1 db2" | |
| tar -cvJf $APP-$DATE.txz -C /var/www/html $DIRS | |
| mysqldump --defaults-file=./backup.ini -uroot --databases $DBS | xz > $APP-$DATE.sql.xz | |
| tar -cvf backup.tar $APP-$DATE.txz $APP-$DATE.sql.xz | |
| rm -f $APP-$DATE.txz $APP-$DATE.sql.xz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment