After Rsync completes data backup, this operation will be automatically terminated. For this purpose, it is best to add a "-a" option for files on the basis of the above command) and a "-e" option to specify the remote shell program to ensure security. In this case, the remote shell uses an encryption protocol, such as ssh, so that the remote shell can use the-e ssh format.
In this case, the above Rsync com
the time stamp window that determines whether a file is in the same time, default is 0-t--temp-dir=dir create temporary files in dir--compare-dest=dir also compares files in DIR to determine whether a backup is required-P equals to--partial--progress Display backup process-Z,--compress compression of backed-up files on transfer--EXCLUDE=PATTERN Specifies to exclude file modes that do not require transfer--INCLUDE=PATTERN Specifies the file mode that
file, just look at the file size regardless of the file time. --modify-window=num determines whether the file is time-stamped with the time Stamp window, which defaults to 0. -T--temp-dir=dir creates a temporary file in Dir. --compare-dest=dir also compares the files in DIR to determine if a backup is required. -P is equivalent to--partial. --progress shows the backup process. -Z,--compress compresses the files that are backed up when they are transf
configuration file, set the Disable property to No, restart the service xinetd restart start the rsync service. 26-1, 26-2:Vi/etc/xinetd.d/rsyncService xinetd RestartAt this point, the configuration of rsync to this step is possible. So how to use rsync next?Case scenario: Do it two o'clock in the morning every day backup backs up the COM directory under the hos
Disable property to No, restart the service xinetd restart start the rsync service. 26-1, 26-2:Vi/etc/xinetd.d/rsyncService xinetd RestartAt this point, the configuration of rsync to this step is possible. So how to use rsync next?Case scenario: Do it two o'clock in the morning every day backup backs up the COM directory under the host directory (/home/formal/)
name -- timeout = time ip timeout TIME, in seconds-I, -- ignore-times does not skip files with the same time and length -- size-only. when determining whether to back up a file, only check the file size, regardless of the file time -- modify-window = NUM determines whether the file is time-stamped, the default value is 0-T -- temp-dir = DIR. Create a temporary file in DIR -- compare-dest = DIR and compare the files in DIR to determine whether to back up-P is equivalent to -- partial --
File Permissions
Chmod 600/etc/server. Pass
Remote ip98 Installation:
1.compile and install rsync-3.1.1.tar.gz
Tar zxvf rsync-3.1.1.tar.gz
CD rsync-3.1.1
./Configre
Make
Make install
2.compile and install inotify-tools-3.14.tar.gz
Tar zxvf inotify-tools-3.14.tar.gz
CD inotify-tools-3.14
./Configure
Make
Make intall
3. Compile the ino
:
parameter Options
Explanatory notes
-V--verbose
Verbose mode output, progress at transfer, etc. information
-Z--compress
Compression during transfer to improve transfer efficiency,--compress-level=num can be compressed by level
-A--archive
Recursively transfers files and maintains properties of all files, equivalent to-RTOPGDL
-R--recur
. After installation, add the installation directory to the PATH variable of windows, so that you can directly call the rsync command under the command line.3. Open the command line window and execute the command
(The IP address of my server is 192.168.31.23)
Upload Command:
Rsync-Av -- Progress -- remove-source-files -- exclude-from =/cygdrive/D/upload. LI
= 600
Refuse options = checksum dry-run
Dont compress = *. gz *. tgz *. zip *. z *. rpm *. deb *. iso *. bz2 *. tbz
For personal information, change path =/home/soft/rsync to your directory.After modification, create a new file rsyncd. pass under/etc /.# Vi/etc/rsyncd. passBackup: backup: WqModify rsyncd. pass permission# Chmod 600/etc/rsyncd. passNow you can start rsync.#
Auth users = Coldstar #同步使用的帐号
Secrets file = Rsyncd.secrets #密码文件
Note:
The format of the Rsyncd.secrets profile is user name: password, such as:
coldstar:123456
That is, a user Coldstar was added with a password of 123456.
To perform synchronization commands on a Linux server:
RSYNC-VZRTOPG--progress--delete Rsync://coldstar@192.168.10.1:52326/t
I. Introduction (do not want to see directly can skip)Migrate Emos servers, the new server has been completed after the test, and then very important work is to complete the old mail system in the mail data migration, the choice of copy of the way naturally, but will inevitably lose some of the mail (in this period received mail), so take into account rsync.
Rsync is a remote data synchronization tool that
' does for CPU load. # as Rsync is often used for backups which aren ' t all that time-critical, # reducing the rsync IO priority would benefit
The rest of the system.
# The manpage for Ionice for allowed options. #-C3 is recommended, this'll run rsync IO at "idle" priority.
Uncomment # The next line to activate this. # rsync_ionice= '-c3 ' # Don ' t forget to c
-tools on the master server
Tar-zxvf inotify-tools-3.14.tar.gzCd inotify-tools-3.14./Configure-prefix =/usr/local/inotifyMake make install
Configure the rsync password file on the master server to synchronize data to the slave server.Vim/etc/rsync. passwd# PasswordRsync
Create scriptVim inotifyrsync. sh
#! /Bin/bashHost = 192.168.6.36Src =/usr/local/nginx/html/wordpress/Dst = wordpressUser = rsyncInotifywa
the configuration file. In the above (1) in the configuration file contents of the # Share a file directory under the "Backup" if "" in the name has changed, you need to change here, 123456 is the password you set.Should be a password file so last set permissionschmod 600/etc/rsync.password4. Start Rsync ServiceRsync--deamonThen add it to boot.5. rsync Client Configuration operationOnly two things on the c
password)
#客户端备份服务器上指定模块中的数据
[root@client ~] #rsync-vzrtopg–progress–delete–password-file=/etc/rsync.pas postfix@192.168.100.1::p ostfix/home/ mail/#备份rsync服务器上postfix中模块指定文件夹 and delete content that is not on the local server
#-v,–verbose Verbose mode output
#-z,–compress compression of backed-up files on transfer
#-r,–recursive in recursive mode for subdirect
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.