Red Flag Linux Server 5.0 Subversion backup strategy implementation __linux

Source: Internet
Author: User
Tags svn knowledge base

Overview

SVN backup generally has 3 kinds of ways: Svnadmin dump, Svnadmin hotcopy, Svnsync, this paper uses a full backup, that is, the use of svnadmin hotcopy of the way to backup. In view of the possibility of hard disk damage and the need for rapid recovery after the disaster, this scheme adopts the way of hotcopy, which requires adding a standby machine for Linux operating system, and also installs SVN service.

The main points of the backup strategy are summarized as follows:

1 backup strategy is a Linux shell script, path:/svn/shell/baksvn.sh

2) baksvn.sh by the Linux crond scheduling operation, at 3:10 every day is automatically scheduled;

3 Consider the disk space limit, the SVN standby only the last 3 days of the backup directory, for the last 3 days before the backup directory, baksvn.sh will be deleted before the backup;

4) due to the Saturday, no work on Sundays, SVN commit less, in Saturday, Sunday if backup, will reduce the difference of the backup catalog version, is not conducive to backup security, so in the BAKSVN to Sunday, Monday does not do SVN backup, only mail notification.

5 The target path for SVN backup is/mnt/svn119, backup directory naming rule: repos+ current date, such as repos20091112. Where/mnt/svn119 is mapped to the/SVN directory of the standby machine.

6 The log information that is backed up is stored in the/svn/shell/logs directory of the host, and the corresponding log file is: current date. Log, such as 20091112.log. After the backup is completed, Baksvn.sh sends the information in this log file to the relevant person via email.

7 if the/SVN directory of the Loading (mount) standby is unsuccessful, the SVN backup is terminated, the backup is considered unsuccessful, the message is only notified, and no other action is taken.

8 after each backup, BAKSVN will obtain some key environmental information of the Linux operating system, and record them together in the log, sent to the relevant people by mail.

9) baksvn.sh supports the ability to send mail. installation Steps

1 The reg Flag DC Server Linux 5.0 operating system, configure the Ftp,telnet service and set it to Automatic startup mode.

2 See the 2.2 chapter, the SVN service of the Android equipment and test pass.

3 Configure the host and standby Linux NFS (network file system) sharing services, on the host and backup, execute the following command:

Chkconfig--level Portmap on

Chkconfig--level NFS On

Service Portmap Start

Service NFS Start

4 Shared Directories and permissions on the open standby machine

Vi/etc/exports

Add the following:

/SVN * (Rw,sync)

Then execute the following command to have the share take effect:

Exportfx-rv

On the host, see if you can view the shared information to the standby, and execute the following command:

SHOWMOUNT-E 172.168.16.119

You should see the following:

5) The shared directory of the loading standby machine

Edit/etc/rc.local, will load (mount) standby directory of the command to join, so that when the host started, can automatically load.

Vi/etc/rc.local

Add the following at the end of the file: Mount-t NFS 172.168.16.119:/svn/mnt/svn119

Manually execute the following command to have the shared directory load take effect:

/etc/rc.local

6 The FTP installation directory under the baksvn.sh copy to the host/svn/shell/directory, and create a new/svn/shell/logs directory

7 Configure the host's SendMail service

A to set the SendMail to start from, execute the following command:

Chkconfig--level SendMail on

b) manual Start SendMail

Service SendMail Start

C to add an accessible SMTP server address to access

Vi/etc/mail/access

Add the following at the end:

Smtp.163.com RELAY

220.181.12.12 RELAY

The following figure:

Then execute the following command:

Makemap Hash/etc/mail/access.db </etc/mail/access

d) Restart the SendMail service

Service SendMail Restart

8) Configure Crond service, daily automatic dispatch baksvn.sh

A to set the Crond service to self-boot

Chkconfig--level Crond on

b) Start Crond

Service Crond Start

c) Increased scheduling tasks

Execute command: Crontab-u root–e

Add the following at the end of the file: 3 * * * sh/svn/shell/baksvn.sh, save exit.

To perform crontab-l, you should see the following:

Restart Crond, and execute the following command:

Service Crond Restart

The installation process is complete.

Overview of Backup recovery steps

You need to perform a secure restore of SVN in the following situations:

1 The Knowledge base of Linux host is damaged, and the lack of version leads to discontinuity and incomplete.

2 The Host SVN service is not normal;

3 host disk damage;

4 host operating system failure, unable to start normally;

For these failures, there are two ways to recover:

Ø Recovery method: Reinstall the host's operating system, SVN service, and then restore the backup directory of the standby to the host computer by reverse svnadmin hotcopy command;

Ø Recovery Method II: Direct use of the standby machine to replace the host service, the standby IP

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.