Summary of methods for remote image and SVN server backup page 1/2

Source: Internet
Author: User


Let's look at a simple svnsync example:
Master SVN server: http: // mastersvn/project1
Deployment on the svnsync image SVN server: http: // backupsvn/project1
Step 1: create a repository
CD/home/SVN
Svnadmin create-FS-type fsfs/home/SVN/project1
Chmod 777-r project1
Step 2: Image Initialization
Svnsync init http: // backupsvn/project1 http: // mastersvn/project1
Step 3: change the configuration file
CD/home/SVN/project1/hooks
Pre-revprop-change CP pre-revprop-change.tmpl
VI pre-revprop-change
Log out of all statements, add # Before the statement, and exit and save.
Step 4: Synchronization
Svnsync sync http: // backupsvn/project1 -- username -- Password
Submitted version 9.
Copy the attribute of version 9.
Submitted version 10.
Copy version 10 attributes
...............
However, in practice, the svn database is often locked.
Svnsync: Couldn't get lock on destination repos after 10 attempts
This has to make us feel a headache to manually use the command to unlock
SVN propdel SVN: sync-lock -- revprop-R0 http: // backupsvn/project1
Here, we have a preliminary understanding of svnsync. It's just a word, annoying !!! Synchronization speed is slow !!!
Certificate ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Next is the key part of this article:
SVN's new image backup solution: SSH + rsync + crontab (Task Plan ))
What is SSH?
SSH is a more flexible and secure alternative to telnet and rlogin. It is widely used in development projects to provide access control and secure data transmission.
What is rysnc?
Rsync is a data image backup tool in Unix-like systems. It can be seen from the software name-Remote Sync. Its features are as follows:
Images can be used to save the entire directory tree and file system.
It is easy to maintain the permissions, time, and soft links of the original file.
Installation without special permissions.
Optimized process, high file transmission efficiency.
You can use RCP, ssh, and other methods to transmit files. Of course, you can also use a direct socket connection.
Supports anonymous transmission for website images.
What is crontab?
Crontab is a command in Linux. It can be used to schedule the daemon process for executing repeated tasks based on the combination of time, date, month, and week. (Similar to the job plan in Windows)
Solution topology: (see the attachment)
Main SVN server environment:
SVN repository root directory:/home/SVN (three repositories: project1, project2, and project3)
SVN Server IP: 192.168.100.80
Image SVN server environment:
SVN repository root directory:/home/SVN (no repository, no need to create, the image will be copied directly and keep the file attributes)
SVN Server IP Address: 192.168.100.81
# Main SVN Server Installation section:
(1)
SVN installation part (omitted)
(2)
Install rsync
Rpm-Qa | grep rsync (whether rsync has been installed on all systems)
Rpm-e rsyncxxx (delete previously installed rsync)
Wget http://samba.anu.edu.au/ftp/rsync/rsync-3.0.4.tar.gz (download rsync source code installation package)
Tar zxvf rsync-3.0.4.tar.gz (extract)
CD rsync-3.0.4
./Install. Sh (installation)
Next, we can enter the rsync -- version command to test whether the installation is successful.
Rsync
Version 3.0.3
Protocol version 30
Copyright (c) 1996-2008 by Andrew tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
64-bit files, 64-bit inums, 32-bit timestamps, 64-bit long ints,
Socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
Append, ACLs, xattrs, iconv, no symtimes
Rsync comes with absolutely no warranty.
This is free software, and you
Are welcome to redistribute it under certain conditions.
See the GNU
General Public Licence for details.
(3) Enable rsync server
/Usr/local/bin/rsync -- daemon (enable rsync)
VI/etc/rc. d/rc. Local
Add/usr/local/bin/rsync -- daemon to the end (to enable the server to run the process automatically after each restart)
# Install the image SVN Server:
(1) SVN installation section (omitted)
(2) install rsync
Rpm-Qa | grep rsync (whether rsync has been installed on all systems)
Rpm-e rsyncxxx (delete previously installed rsync)
Wget http://samba.anu.edu.au/ftp/rsync/rsync-3.0.4.tar.gz (download rsync source code installation package)
Tar zxvf rsync-3.0.4.tar.gz (extract)
CD rsync-3.0.4
./Install. Sh (installation)
Next, we can enter the rsync -- version command to test whether the installation is successful.
Next, we have completed the configuration. Let's use the test in our life.
Synchronization command:
Rsync-vzrtopgu -- Progress -- delete root@192.168.100.80:/home/SVN/home/
Enter the user name Root
Enter the root password.
65309 100%
224.57kb/s
0:00:00 (xfer #507, to-check = 2187/23106)
SVN/project1/DB/revs/202
29655 100%
99.86kb/s
0:00:00 (xfer #508, to-check = 2186/23106)
SVN/project1/DB/revs/203
7242 100%
23.19kb/s
0:00:00 (xfer #509, to-check = 2185/23106)
Sent 15928 bytes
Received 521860019 bytes
4404016.43 Bytes/sec
Total size is 12240235825
Speedup is 23.45
After the transmission is completed, the image process is complete.

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.