Summary of SVN scheduled backups in Linux

Source: Internet
Author: User
Tags svn

Svnserver scheduled backup summary in Linux:

This article is mainly combined with the previous about the "Linux build svnserver Summary", to explain how to backup Svnserver under Linux, to prevent the individual situation caused by the serious consequences of data loss.

The implementation process is basically: we need to create a new backup SH script and then run the previous script using Contab. And the success of the simulation verification, it is still relatively simple.

Ps:

As for the specific introduction of Contab will be listed in the summary. Just click here to do this.

"Linux Build Svnserver Summary" address:

http://blog.csdn.net/why_2012_gogo/article/details/47361497

· SH Backup script

· Timed Run SH

· Analog Run SH

1. Sh Backup script

Create a backup folder

#mkdir/opt/project_backup

Edit Backup Script

#cd/HOME/SVN

#vim project_backup.sh

The script contents are as follows:

Cd/home/svn

now= '/bin/date +%y%m%d '

/bin/tar czvf "project_backup_$now.tar.gz" project/&& rm-rf/opt/project_backup/* &&/bin/mv projec t_backup_*.tar.gz/opt/project_backup/

If[$?==0]

Then

result= "OK"

Else

result= "Fail"

Fi

For example, the following:

Note:

Now: Call the date function. Generate the following required date to prepare for the file name word;

/bin/tar: Package A backup, delete the old backup, and move the new backup.

2. Timed Operation SH

#contab-E

Type the content:

0 ***/home/svn/project_backup.sh

Note:

0 24: Run this backup script on behalf of 24 points per day

The results are as follows:

3. Analog Run SH

#./home/svn/project_backup.sh

#cd/opt/project_backup

To view the backup:

Technical Discussion Group (new):

182437336


Summary of SVN scheduled backups in Linux

Related Article

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.