Created
November 4, 2013 17:36
-
-
Save bitless/7306286 to your computer and use it in GitHub Desktop.
backup database and wp uploads to svn
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
PATH='/bin:/usr/bin' | |
## vars | |
dbs='dbase' | |
dbu='user' | |
dbp='pass' | |
dbdump='dump.sql' | |
svnu='svnuser' | |
svnp='svnpass' | |
sitepath='/var/www/sites/www.site.com' | |
innerpath='wp-content/uploads' | |
bakpath='/home/bakuser/backups/www.site.com-svn-tag-backup' | |
ts=$(date +%Y%m%d.%H%M%S) | |
## action | |
mysqldump --databases $dbs -u$dbu -p$dbp > $bakpath/$dbdump | |
rsync -va $sitepath/$innerpath $bakpath | |
svn add --force $bakpath/* | |
svn -m "Backup Agent db/upload backup $ts" commit $bakpath/* | |
## done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment