Use svnsync to synchronize and back up svn versions from one server to one server

Source: Internet
Author: User
For example, svnsync is used to synchronously back up svn of two machines. (Take linux server to windows server as an example) Name of the project to be synchronized: source_svnsvn version 1. 4. above source Directory: svn: 192.168.16.199source _ svn synchronization target directory: http: Destination IP: 8080source_svnbak method: 1. If

ExampleSvnsyNc Synchronous backup of two machinesSvn. (Take linux server to windows server as an example)

Project name to be synchronized:Source_svn

SvnVersion Library1.4Above
Source directory:Svn: // 192.168.16.199/source_svn
Synchronization target directory:Http :// TargetIP: 8080/source_svnbak

Method:

1. If the target directory has the same project, clear the project and create a new empty project.

2. create the svn version library source_svnbak svnadmin create source_svnbak on the target server (svnadmin is svn's CommandIf the svn directory is not put into the environment variable, you need to use this sentence in its directory. If it is windows, you can right-click to create svn)

3. You need to change pre_revprop_change.tmplPre_revprop_change.bat, clear the content, and enterExIt 0

4. Execute Initialization

SvnSyncInit svn: // destination: ip: Port Number/source_svnbak svn: // 192.168.16.199/source_svn

(This usually causes svnsync: authentication fails.) solution: copy the conf file in the source file source_svn to the target source_svnbak and replace the conf file.

If it succeeds, the system will prompt you to enter the user name and password (note: the first one is AdminisTrAtor. I don't think you can just enter it. After confirmation, the user name and password you entered in svn are configured in the conf file)

After it is correct, it is displayed

CopiEdProperties for revision 0. (copy the attribute of version 0 .)

5

Execute Synchronization

Svnsync sync svn: // target ip address and port number/source_svnbak -- username xxxx -- password xxxx (generally, you do not need to write the port number unless it is not installed by default, both the user name and password are configured in conf)

That is, the target library of svnsync sync

After the command is correctly executed

Copy version number and submit data

6. Update Synchronization

Add the post-commit script Under hooks of source_svn.

Copyable post-commit.tmpl

That is
 

CpPost-commit.tmpl post-commit

Then

Replace the last two rows in post-commit
 

Svnsync sync -- non-interactive svn: // target ip Address: (Port Number)/source_svnbak -- username xxx -- password xxx

After an update is submitted, the synchronization command is executed without interaction.

Set post-commit to 755.

 

Ps:

If the post-commit script has an error or has no execution permission, an error is reported when an update is submitted.

Error Handling : 
Source end ,The account used for synchronization must have the read permission. ,Read and write permissions are required for the target synchronization account .After reasonable permission allocation , Basically, no other errors will occur. .

If any of the following errors occur ,

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.