Internal SVN service Setup

Source: Internet
Author: User
Tags tortoisesvn

The company needs to build an SVN server for developers to use, the construction process is organized.


Service side

# Yum Install Subversion

Client
TortoiseSVN, official website download: http://tortoisesvn.net/downloads.html

# svnadmin Create/svn/project

# vi/svn/project/conf/svnserve.conf

[General]

Anon-access = None

auth-access = Write

Password-db =/svn/project/conf/passwd

Authz-db =/svn/project/conf/authz

realm = My Test Repository # This is a message .

Add user

# VIM/SVN/JICHUANG/CONF/PASSWD

[Users]

Jichuang = Jichuang
YANGMV = 123456

Save

Configure authorization files for new users

# Vim/svn/jichuang/conf/authz

[Groups]

admin = YANGMV

user = Jichuang

[/]

@admin = RW

@user = r

* =

Save

Start SVN Service
# svnserve-d-r/svn/jichuang/

join self-starter /etc/rc.d/rc.local

# Ps-ef|grep SVN

Firewall

# iptables-a input-s 10.10.50.0/24-d 10.10.50.103-p tcp--dport 3690-j ACCEPT

# iptables-a output-s 10.10.50.103-d 10.10.50.0/24-p tcp--sport 3690-j ACCEPT

Backing up the SVN repository

# Compress Backup
Svnadmin Dump/svn/jichuang | gzip >/svn/backup/jichuang-backup.gz
#不压缩备份
Svnadmin Dump/svn/jichuang >/SVN/BACKUP/JICHUANG-BACKUP.SVN

Recovering the SVN repository

# Create a new SVN repository
Svnadmin Create/svn/jichuang
#导入存储库数据
Svnadmin Load/svn/jichuang </SVN/BACKUP/REPOSITORY-BACKUP.SVN

Backup scripts

#vim/etc/crontab

XX 011 * */root/svn_scripts/full.sh

XX 02* * */root/svn_scripts/add.sh

Full backup

#!/bin/sh

date=$ (DATE +%y%m%d:%h:%m:%s) # defining time variables for file name suffixes

Svn_dir=/svn/jichuang # defining SVN Library Directory variables

Svn_bak_dir=/svn/backup # define backup files to store directory variables

echo ' 0 ' >/tmp/jichuang_svn_id # Initialize the version number, the full library backup must be from the 0 version number >

Begin

num1=$ (cat/tmp/jichuang_svn_id) # take the initialization version number

num2=$ (Svnlook youngest $SVN _dir) # take the current version number

# Start Backup

Svnadmin dump $SVN _dir-r $NUM 1: $NUM 2--incremental> $SVN _bak_dir/jichuang_f

Ull_bak_$date

# Determine if the backup was successful and, if successful, record the current latest version number to the temporary file for the next incremental backup >

Use

If [$?-eq 0];

Then

echo $NUM 2 >/tmp/jichuang_svn_id

Else

echo "Backupfail ..."

Fi

Incremental backup

#!/bin/sh

date=$ (DATE +%y%m%d:%h:%m:%s) # defining time variables for file name suffixes

Svn_dir=/svn/jichuang # defining SVN Library Directory variables

svn_bak_dir=/svn/backup/# define backup files to store directory variables

num1=$ (cat/tmp/jichuang_svn_id) # take the initialization version number

num2=$ (Svnlook youngest $SVN _dir) # take the current version number

# Start Backup

Svnadmin dump $SVN _dir-r $NUM 1: $NUM 2--incremental> $SVN _bak_dir/jichuang_a

Dd_bak_$date

# Determine if the backup was successful and, if successful, record the current latest version number to the temporary file for the next incremental backup >

Use

If [$?-eq 0];

Then

echo $NUM 2 >/tmp/jichuang_svn_id

Else

echo "Backupfail ..."

Fi


This article is from the "Brother" blog, please be sure to keep this source http://yangmv.blog.51cto.com/2366107/1665590

Internal SVN service Setup

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.