Guest User

Untitled

a guest
Mar 11th, 2018
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. # change these for your system (they're different on non-shared accelerators)
  2.  
  3. BACKUP_DIR='/users/home/[USER_NAME]/backups'
  4. RSYNC_PATH='/usr/local/bin/rsync'
  5. MYSQL_PATH='/usr/local/bin/mysqldump'
  6.  
  7. # databases - repeat for each, changing database user and passowrd as necessary
  8. $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
  9.  
  10. # remove older files
  11. /opt/csw/bin/gfind $BACKUP_DIR/*.gz -mtime +7 -delete
  12.  
  13. #rsync mysql files (no delete -- strongspace will accumulate older files to infinity)
  14. $RSYNC_PATH -avz $BACKUP_DIR*.gz [USER]@[USER].strongspace.com:[PATH/TO/YOUR/BACKUPS]
  15.  
  16. # if you wanted to not accumulate older files on strongspace, you could do this:
  17. # $RSYNC_PATH -avz --delete $BACKUP_DIR/ [USER]@[USER].strongspace.com:[PATH/TO/YOUR/BACKUPS/WITH/TRAILING/SLASH/]
  18.  
  19. # RSYNC SVN
  20. $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