Current location - Quotes Website - Team slogan - What do you mean you can't find yodl2man when compiling and installing rsync?
What do you mean you can't find yodl2man when compiling and installing rsync?
I. Introduction to rsync

A tool to replace rcp, rsync can be used through rsh or ssh, and can also run in guardian mode. When running in guardian mode, rsync.

The server will open an 873 port and wait for the client to connect. When connecting, rsync

The server will check whether the passwords are consistent. If the password is verified, the file can be transferred. When the first connection is completed, the whole file will be transferred once, and then only incremental backup is needed.

Second, rsync common parameters

-v, -verbose detailed mode output;

-a, -archive archiving mode, which means to transmit files recursively and keep all file attributes unchanged, is equivalent to using the combination parameter-rlptgod;

-r, -recursive processes subdirectories in recursive mode;

-l, -links keep soft links;

-p, -perms reserves file permissions;

-t, -times saves file time information;

-g, -group saves the information of the group to which the file belongs;

-o, -owner saves file owner information;

-d, -devices saves device file information;

-h -H,-hard-links keep hard links;

-s, -sparse performs special processing on sparse files to save DST space;

-delete deletes files that cannot be found in the SRC of DST;

-z, -compress compresses the backed-up files during transmission;

Three, six different working modes of rsync;

1) copy local files;

Enable this working mode when the SRC and DES path information does not contain the colon ":"separator:

[root @ cmmailapp 1/]# rsync-avSH/home/coremail//cmbak/

2) Use remote shell programs (such as rsh and ssh) to copy the contents of the local machine to the remote machine, and start this mode when the DST path address contains the colon ":"separator;

[root @ cmmailapp 1/]# rsync-avSH/home/coremail/ 192. 168. 1 1. 12:/home/coremail/

3) Use remote shell programs (such as rsh and ssh) to copy the contents of the remote machine to the local machine, and start this mode when the SRC address path contains the colon ":"separator;

[root @ cmmailapp 2/]# rsync-avSH 192. 168. 1 1. 1 1:/home/coremail//home/coremail/

4) Copy the file from the remote rsync server to the local machine. This mode is started when the SRC path information contains the delimiter "::".

Such as: rsync-avroot @172.16.78.192:: www/databack.

5) Copy the file from the local machine to the remote rsync server. This mode is started when the DST path information contains the delimiter "::".

Such as: rsync-av/databackroot @172.16.78.192:: www.

6) List the files of the remote machine. This is similar to rsync transmission, but as long as the local machine information is omitted from the command.

Such as rsync-vrsync:/192.168.11.1/data.

Fourthly, the configuration of rsync server;

Environment:192.168.1.1is a production machine; 192.168.11.12 is the backup machine;

Then192.168.11.1needs to be a client; Rsync's;

192.168.11.12 as the server of rsync;

1,192.168.11.12 _ Configuration of service terminals;

1) [root @ cmmailapp2data] # touch/etc/rsyncd.conf//This file is the main configuration problem of rsync, and it does not need to be created manually by default;

2) Define the configuration of synchronization;

[root @ cmmailapp 2 data]# cat/etc/rsyncd . conf

[data]

Path =/data/

auth users = coremail

uid = root

gid = root

Confidential file = /etc/rsyncd.secrets

Read only = No.

[mysql]

Path = /home/coremail/var/mysql

auth users = coremail

uid = root

gid = root

Confidential file = /etc/rsyncd.secrets

Read only = No.

[cmxt]

Path = /home/coremail/

auth users = coremail

uid = root

gid = root

Confidential file = /etc/rsyncd.secrets

Read only = No.

3) Define the password file/etc/rsyncd.secrets.

[root @ cmmailapp 2 data]# cat/etc/rsyncd . secrets

Core mail: core mail

4) start rsync startup service

[root @ cmmailapp 2 data]# cat/etc/xinetd . d/rsync

# Default: Off

# description: rsync server is a good complement to ftp server because it \

# Allow crc checksum, etc.

Service synchronization

{

Disable = yes // needs to be modified to no;

Socket type = stream

Wait = No.

User = root

server = /usr/bin/rsync

Server_args =-daemon

Login failed+= User ID

}

[root @ cmmailapp 2 data]# chk config-level 2345 rsync on

[root @ cmmailapp 2 data]# chk config rsync on

[root @ cmmailapp 2 data]# chkconfig-level 2345 xinetd on

[root @ cmmailapp2data] # servicexinetd restart.

Stopping xinetd: [OK]

Starting xinetd: [OK]

2.192.168.1.1_ client configuration;

[root @ cmmailapp 1/]# cat/etc/rsyncd . secrets

coremail

[root @ cmmailapp 1/]# rsync-aSvH-password-file =/etc/rsyncd . secrets/home/coremail/coremail @ 192. 168. 1 1. 12::data

[root @ cmmailapp 1/]# rsync-aSvH-password-file =/etc/rsyncd . secrets/home/coremail/coremail @ 192. 168. 1 1. 12::MySQL

[root @ cmmailapp 1/]# rsync-aSvH-password-file =/etc/rsyncd . secrets/home/coremail/coremail @ 192. 168. 1 1. 12::cmxt

5. Define timed self-rsync synchronization, and specify the path where the synchronization log is located /var/log/rsync/

[root @ cmmailapp 1 log]# cat/root/rsync . sh

DATE=`date +%Y%m%d%H%M '

rsync-aSvH-password-file =/etc/rsyncd . secrets/home/coremail/coremail @ 192. 168. 1 1. 12::data & gt; /var/log/rsync.date.$DATE

rsync-aSvH-password-file =/etc/rsyncd . secrets/home/coremail/coremail @ 192. 168. 1 1. 12::MySQL & gt; /var/log/rsync.mysql.$DATE

rsync-aSvH-password-file =/etc/rsyncd . secrets/home/coremail/coremail @ 192. 168. 1 1. 12::cmxt & gt; /var/log/rsync.cmxt.$DATE

chmod u+x /root/rsync.sh

[root @ cmmailapp 1 log]# crontab-l

0 3 * * * /root/rsync.sh

Date record file during execution:

[root @ cmmailapp 1 log]# ls | grep ' rsync '

rsync . cmxt . 20 1 1 10 1809 15

rsync . date . 20 1 1 10 1809 15

rsync . MySQL . 20 1 1 10 1809 15