Svnsync:subversion a good tool for backing up the repository

Source: Internet
Author: User
Tags svn knowledge base
svnsync:subversion a good tool for backing up the repository From svn Knowledge BaseRevision as of 22:35 February 19, 2008; View Current revision
←older Revision | Newer Revision→jump to:navigation, search
Author: pcplayer
From: I use subversion-http://www.iusesvn.com
Date: 2008-1-2


This article describes the use of Svnsync to synchronize the repository, to achieve the purpose of backing up the repository

There are two commands to use.

1. Svnsync Init

Initialize, establish a synchronization relationship between the target library and the source library

Command format svnsync init target library URL Source Library URL

2. Svnsync Sync

True synchronization

Command format svnsync sync target library URL


Goal:

This implementation is the remote automatic backup of the repository, backup the repository to another machine

Suppose we want to synchronize the source repository for http://192.168.0.1/svn/proj1 located at machine A, the specific path we don't have to ignore because we use the HTTP protocol

Target library in Machine b,file:///svn/proj1, this for simplicity and security, we use file://protocol

Process:

1. On machine B, create the target library

Mkdir/svn

Svnadmin create/svn/proj1

2, modify the target library script Pre-revprop-change

Enter/svn/proj1/hooks/

cd/svn/proj1/hooks/

CP Pre-revprop-change.tmpl Pre-revprop-change

VI Pre-revprop-change

   Repos= "$"
rev= "$"
User= "$"
Propname= "$4"
Action= "$"
If ["$ACTION" = "M"-a "$PROPNAME" = "Svn:log"]; Then exit 0; Fi
echo "Changing revision properties other than Svn:log is prohibited" >&2
Exit 1

The original script means that if you modify the Svn:log property, it will allow the modification to return 0; otherwise, it is not allowed to return 1

We want to change it to allow all properties to be modified, return 0 directly in the script, the new script is as follows:

   Exit 0;

3. Initialization

Svnsync init file:///svn/proj1 http://192.168.0.1/svn/proj1 will prompt for a user name and password, the user name and password provided here are fully readable http://192.168.0.1/svn/ PROJ1 User name and password

4. Synchronization

Svnsync Sync file:///svn/proj1


You will still be prompted for your username and password, but you can add the username, password parameters after this command,

For example Svnsync Sync file:///svn/proj1--username username--password password

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.