SVN uses dump and hotcopy for script backup

Source: Internet
Author: User

[[email protected]shell]# Cat Repolist Dev-arc
Dev-bm
Dev-crm
Dev-pay
dev-pm
Dev-portal
Dev-risk
hr
Product
Qa
rep-ops[[email protected]shell]# Cat svnbackup.sh #!/bin/bash
rm-rf/yc/backup/dump/* &>/dev/null
rm-rf/yc/backup/hotcopy/* &>/dev/null
date=$ (Date +%y%m%d)
###################### #dump backup###############################
For i in ' cat/shell/repolist '
Do
/yc/usr/local/subversion/bin/svnadmin dump/yc/svn/$i >/yc/backup/dump/$i-$DATE. dump.gz
Done
If [$?-eq 0];then
echo "$DATE/yc/usr/local/subversion/bin/svnadmin dump full backup successful." >>/var/log/svnbackup.log
Else
echo "$DATE/yc/usr/local/subversion/bin/svnadmin dump full backup failed." >>/var/log/svnbackup.log
Fi
Ssh[email protected]"Mkdir/yc/svn/backup/dump/$DATE"
Scp-r/yc/backup/dump/*[email protected]:/yc/svn/backup/dump/$DATE &>/dev/null
If [$?-eq 0];then
echo "$DATE Transfer svn dump Backup to 10.11.100.205 successful." >>/var/log/svnbackup.log
Else
echo "$DATE Transfer svn dump Backup to 10.11.100.205 failed." >>/var/log/svnbackup.log
Fi
###################### #hotcopy backup###############################
For i in ' cat/shell/repolist '
Do
/yc/usr/local/subversion/bin/svnadmin hotcopy/yc/svn/$i/yc/backup/hotcopy/$i
Done
If [$?-eq 0];then
echo "$DATE/yc/usr/local/subversion/bin/svnadmin hotcopy Full backup successful." >>/var/log/svnbackup.log
Else
echo "$DATE/yc/usr/local/subversion/bin/svnadmin hotcopy Full backup failed" >>/var/log/svnbackup.log
Fi
Ssh[email protected]"Mkdir/yc/svn/backup/hotcopy/$DATE"
Scp-r/yc/backup/hotcopy/*[email protected]:/yc/svn/backup/hotcopy/$DATE/&>/dev/null
If [$?-eq 0];then
echo "$DATE Transfer svn hotcopy Backup to 10.11.100.205 successful." >>/var/log/svnbackup.log
Else
echo "$DATE Transfer svn hotcopy Backup to 10.11.100.205 failed." >>/var/log/svnbackup.log
Fi Note: **subversion use the absolute path because the source package is used for installation. **

SVN uses dump and hotcopy for script backup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.