is only used to synchronize updated files to avoid repeated updates to non-updated files. Note the clock synchronization between the two machines.
-- Progress indicates that the detailed progress is displayed,
-- Delete: if the server deletes the file, the client also deletes the file to ensure true consistency. The following roger@192.168.5.13: linuxsirhome, after linuxsirhome is the module name, that is,
Rsync configuration and installation, rsync Configuration
Rsync Installation
1. extract the rsync package, package link: https://pan.baidu.com/s/1jHPosXC password: maay2. enter the rsync installation package run command :. /configure -- prefix =/usrmakemake install3. Go To T
Some rooms will limit the flow of the machine, in order to not touch the bottom line, in the use of SCP and rsync should pay attention to.In order to avoid the disconnection caused by your SCP or the Lazy OPS Setup firewall, we have to limit the flow of our data, and it's better to be slower than pinched. Therefore (limited to 1M bytes/s):
Scp-l 10000 A large file your account @ remote machine or rsync is
synchronize the laptop to a remote server. To do this, you can use code similar to listing 1. You can also synchronize the remote server to the notebook file to send the slave server to the notebook), or synchronize two local directories, but cannot synchronize the two remote servers.
Listing 1. Two versions with the same rsync command
rsync --compress --recursive --delete --links \--times --
: User name: Password, is clear text
# vi/etc/rsyncd.secrets
backup:123456
# chmod 600/etc/rsyncd.secrets
Create a log or run a directory
# Mkdir/var/rsync
3. Start the service
# rsync--daemon
4. Edit/etc/xinetd.d/rsync (Optional Step)
Rsync service monitoring is distributed uniformly by xinet
Service
)>vim/etc/rsyncd.passwd123456The content is the root password, refer to the server side of the/etc/rsyncd.passwd file settings.2. Modify File Permissions>chmod 600/etc/rsyncd.passwd3. Perform synchronization commands>rsync-vzrtopg--progress [email protected]::builds/builds--password-file=/etc/rsyncd.passwdcan also be executed backstage >rsync-vzrtopg--
should use:rsync-avhe SSH--delete/home/user/dir/[email protected]:d ir/If you want to know the speed of file transfer and how much more you need to replicate, you can add the--progress switch:rsync--progress-avhe ssh--delete/home/user/dir/[email protected]:d ir/If you do not want to be prompted to enter your password each time you use rsync, make sure you use th
. Provide the correct module name or modify it on the server to the module you want to solve the problem.
Question 1:Problems encountered on the client:Rsync-auzv -- progress -- password-file =/etc/rsync. pas root@192.168.133.128: backup/home/Rsync: cocould not open password file "/etc/rsync. pas": No such file or dire
Tags: rsync introduction rsync common options rsync six modesI. Introduction of RsyncThe rsync command is a remote data synchronization tool that enables fast synchronization of files between multiple hosts via Lan/wan. Rsync uses the so-called "
files in Dir to determine whether to back up data.
**-P ** is equivalent to -- partial
** -- Progress ** displays the backup process
**-Z **, -- compress compresses the backup files during transmission
** -- Exclude = pattern ** specifies the file mode that does not need to be transmitted.
** -- Include = pattern ** specifies the file mode to be transmitted without exclusion
** -- Exclude-from = file ** exclude files in the specified mode in file.
**
is required#-p equivalent to--partial#--progress Show Backup process#-z,--compress compress the backed-up files on transfer#--exclude=pattern specify to exclude file modes that do not need to be transferred#--include=pattern specifies file modes that need to be transferred without exclusion#--exclude-from=file exclude files in the specified schema in file#--include-from=file does not exclude files that specify pattern matching#--version Print version
Determines whether the file is time-stamped with the time Stamp window, which defaults to 0. -T--temp-dir=DIRCreate a temporary file in Dir. --compare-dest=DIRalso compare the files in dir to determine if a backup is required. -P is equivalent to--partial. --progress shows the backup process. -Z,--compress The files that are backed up are compressed at the time of transmission. --exclude=pattern Specifies to exclude file patterns that do not need to
Scp–secure copy (remote file copy program)SCP = cp + SSH, the SSH protocol will copy files with the remote host.
How to useSCP option File_source File_targetFor remote path, use [email protected]_ip:file form (of course if you use SSH key on the remote host to omit) for example:scp /home/wgjak47/A.md [emailprotected]:/tmp/B.md
About optionsThe SCP has fewer replication options than CP, and you can use the-r and-p options for recursive copying and preserving the original properties,
directory. It does not matter with the server configuration, but the content has only one password and must be consistent with the server.According to the above server configuration, the content here should be:RsyncThen modify the File Permission:Chown root. root rsync. psChmod 600 rsync. ps2. Place the rsync command into the scheduled task (crond). Assume that
-tools/inotify-tools-3.14.tar.gz [[email protected] src]# tar zxvf inotify-tools-3.14. Tar. gz [[email protected] src]# CD inotify-tools-3.14 [[email protected] inotify-tools-3.14]#.Configure--prefix=/usr/local/inotify [[email protected] inotify-tools-3.14]# make [email Protected] inotify-tools-3.14]# make install 4. Create an rsync replication scriptThis feature is mainly the server side of the directory/TMP content, if modified (whether add
@ $ RHOST: $ RPATH $ LPATH
# The-I $ KEY parameter must be added to the "Command" in the last line. It is blank after $ SSH.
[End of file, excluding this line]
Run the command once to check whether it is normal.
If everything is normal, you can actually set rsync. the-avz parameter in the last line of sh command is changed to-az. After all,-v is used when we want to "Capture and view progress.
5. Join the
common options are as follows:
rsync Common Parameters
Options
Description
-A,--archive
Archive mode, keeping all file attributes equal to-rlptgod
-V,--verbose
Details output
-R,--recursive
Recursive handling of subdirectories
-R,--relative
Using relative path information
-B,--backup
Create a backup
-Z,--compress
Compress files that are
drop it, or delete it, for example:
Zhouda#vi RSYNCD.MOTD
Write:
welcome!
===================== 3> start rsync service =======================
Zhouda#/usr/bin/rsync--daemon--config=/etc/rsyncd/rsyncd.conf
============ 4> master server is already configured rsync! Below we set the ============ from the serverJust install
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.