Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # change these for your system (they're different on non-shared accelerators)
- BACKUP_DIR='/users/home/[USER_NAME]/backups'
- RSYNC_PATH='/usr/local/bin/rsync'
- MYSQL_PATH='/usr/local/bin/mysqldump'
- # databases - repeat for each, changing database user and passowrd as necessary
- $MYSQL_PATH --opt --lock-tables=false --skip-add-locks --user=[USERNAME-VSERVER] --password=[PASSWORD] [DATABASE_NAME] | gzip > $BACKUP_DIR/[DATABASE_NAME]_`date "+%Y-%m-%d"`.gz
- # remove older files
- /opt/csw/bin/gfind $BACKUP_DIR/*.gz -mtime +7 -delete
- #rsync mysql files (no delete -- strongspace will accumulate older files to infinity)
- $RSYNC_PATH -avz $BACKUP_DIR*.gz [USER]@[USER].strongspace.com:[PATH/TO/YOUR/BACKUPS]
- # if you wanted to not accumulate older files on strongspace, you could do this:
- # $RSYNC_PATH -avz --delete $BACKUP_DIR/ [USER]@[USER].strongspace.com:[PATH/TO/YOUR/BACKUPS/WITH/TRAILING/SLASH/]
- # RSYNC SVN
- $RSYNC_PATH -avz --delete /home/[USER_NAME]/svn whatcould@whatcould.strongspace.com:[PATH_TO_YOUR_BACKUPSWITH/TRAILING/SLASH/]
Add Comment
Please, Sign In to add comment