, you only need to check the file size, regardless of the file time.-Modify-window = NUM: Specifies the timestamp window used to determine whether the file time is the same. The default value is 0.-T-temp-dir = DIR: create a temporary file in DIR-Compare-dest = DIR: compare the files in DIR to determine whether to back up data.-P is equivalent to-partial.-Progress displays the backup process-Z,-compress compresses backup files during transmission-Excl
=============== problems occur ================================
Third, start rsync server
Two ways to start an rsync server
1, start rsync Server (Independent launch)
#/usr/bin/rsync--daemon
2, Start rsync server (with XINETD super process startup)
#/etc/rc.d/init.d/xinetd
I found that this problem has been thought to be a server problem twice, because of a machine appeared this problem, originally for security special cancellation file write and Modify permissions. Through McAfee's modify permissions, the problem is resolved, so there is a problem, first check directory permissions issues.
Rsync Error:some Files/attrs were not transferred (* previous errors)
Cwrsync rsync E
-- progress -- delete root@118.244.216.177: logs/data/lnmp
2.If you want to log on to rsync without a password, you only need to configure the password file on the client.
Vim/etc/rsyncd. secretes. This file only contains the server-side auth user password and does not need to be configured with the user name.123456Chmod 600 rsyncd. secretes (the Password File Permission is 600, which must be set in this s
! 192.168.152.155 -- dport 873-J Drop In this case, only the Client IP 11.22.33.44 can enter this rsync server.
7. Configure rsync Client 1. Set the password # Vi/etc/rsyncd. pw 111111 Modify permissions # Cd/etc # Chown root. Root rsyncd. pw # Chmod 600 rsyncd. pw 2. Connect the client to the server Retrieving files from the server /Usr/bin/rsync-vzrtopg --
inotify, and through rsync real-time synchronization to the client's/TMP, the following is implemented through the shell script.
#!/bin/bash
host=192.168.10.221
src=/tmp/
des=web
user=webuser
/usr/local/inotify/bin/ Inotifywait-mrq--timefmt '%d/%m/%y%h:%m '--format '%T%w%f%e '-e modify,delete,create,attrib $src \
| while read fi Les
do
/usr/bin/rsync-vzrtopg--delete--
normal SSH remote login service is 22, but some people are protecting the server from too much cyber attacks, and will change the SSH connection to another number, for example, 12345, but in this way, when using rsync for remote backup data, You will also need to follow the designation of the connection port number.
Suppose 192.168.1.12 This server has an SSH service connection of 12345, below is an example of the data backup data from
initiating an rsync transfer with rsync itself. it's the same binary as the daemon, just without the "-- daemon" flag. it's simplicity is a valid ue. i'll start with a CommandLine that I use in a script to synchronize a web tree below.
rsync --verbose --progress --stats --compress --rsh=/usr/local/bin/ssh --
Tags: res rsync specifies create List start service technology RTP UIDI. Introduction of RSYNC ToolsRsync is a data-mirroring Backup tool under Unix-like systems, and--remote sync can be seen from the name of the software. Rsync is a file synchronization and data Transfer tool under the Linux system that uses the "rsync
function-R: Recursive replicationNote: In the rsync command, if the source path is a directory and the end of the replication path contains/, the contents of the directory are copied, not the directory itself, and if there is no/at the end of the path, the directory itself and all files in the directory are synchronized.Whether the end of the destination path is/does not mattereg# rsync/etc/yum.repo.d/tmp/
or file system, with a considerable transmission rate. It supports secure data transmission through SSH and anonymous data transmission.
3.) rsync mode:
Shell mode, similar to the CP command, also known as local file transfer mode.
The remote shell mode is similar to the SCP command. You can use the SSH protocol to host the remote transmission process.
List mode: the content in the data source is displayed in the list mode. You can also use it remot
want to sync something to the destination, you can use the –exclude option to hide, rsync still attaches great importance to everyone's privacy, you can use the –exclude option many times to set a lot of "privacy."
If you want to hide too much privacy, set in the command-line option is more cumbersome, rsync is still very considerate, it provides the –exclude-from option, so you can put the privacy one by
important. Set rsync. pas to be owned by the root user and the permission is 600.
Cd/etc
Chown root. root rsync. pas
Chmod 600 rsync. pas
Chmod 600 rsyncd. conf
8. Make the configuration take effect
Service xinetd restart
9. Start rsync server
RSYNC server startup
/Usr/bin/
source serverRSYNC-AVH--port=873--progress--delete/home/www.osyunwei.com/[email protected]::home_www.osyunwei.com-- Password-file=/etc/passwd.txtRSYNC-AVH--port=873--progress--delete/home/www.osyunwei.com/[email protected]::home_www.osyunwei.com-- Password-file=/etc/passwd.txtAfter the completion of the operation, respectively on the two target server 192.168.21.127,192.168.21.128 view, in the/home/www.osy
machine to the local machine. When SRC
This mode is started when the address path contains a single colon ":" Separator.
4. Copy files from remote rsync server to local machine. This mode is started when the SRC path information contains the "::" delimiter.
5. Copy files from local machine to remote rsync server. This mode is started when the DST path information contains the "::" separator.
6. List of fil
/]/usr/bin/rsync-vlzrtogp -- progress -- delete 98syn@x.x.x.168 :: 98 html/usr/local/apache/htdocs/pub/html/-- password-file =/etc/rsync98.scrt
In the preceding command line-In vzrtopg, v represents verbose (details), z represents zip (compression), and r represents recursive (recursion ), topg is a parameter that maintains the original attributes of a file, such as the owner and time. --
"::" delimiter.
such as: Rsync-av Root@172.16.78.192::www/databack
(5), rsync [OPTION] ... SRC [user@]host::D EST
Copy files from the local machine to the remote rsync server. This mode is started when the DST path information contains the "::" separator.
such as: Rsync-av/databack root@172.16.78.192::www
18, the
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.