to rsync transmission, but simply omitting the local machine information in the command.-A operates in archive mode, replicates directories, symbolic connections equivalent to-rlptgod
Parameters in Rsync
-R is recursive-L is a linked file, meaning copy linked file,-p to maintain the original permissions of the file,-T to maintain the original time of the file,-G to maintain the original user group,-O to ma
and retain the original attributes of the file;
-P: retain the File Permission;
-T: The timestamp of the file to be retained;
-L: Reserved Symbolic Links
-G: reserved group
-O: retain the owner
-D: Keep the device file.
-E ssh: Use SSH for transmission;
-Z: Compressed and transmitted;
-- Progress: display progress bar
-- Stats: shows how to perform compression and transmission.
Note: In the
, 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-Exclude = PATTERN: Specifies the file mode
Synchronization
Rsync-parameter username @ sync Server IP: Module name in the square brackets in rsyncd. conf) Local Storage path for the content is as follows:
Rsync-vzrtopg-delete -- progress -- exclude "*. log" lansgg@192.168.182.130: lansggtest/root/backup -- password-file =/etc/rsyncd. pass
The command is interpreted as follows:-V indicates that verbose dis
block device file;-Z compression during transmission;-P transmission progress;-V transmission progress and other information. It has something to do with-P. Try it on your own. You can see the document;Scenario 2:# Rsync-avzP -- delete david@172.16.1.135: david home/tmp/david/This time, we introduce the-delete option, indicating that the data on the client must
do not have the "David home" directory on the client, the system will automatically create one for you. If the directory David home exists, pay attention to its write permission.
Note:-A parameter is equivalent to-rlptgod.-R indicates recursive-L indicates a link file, which means copying a link file;-P indicates retaining the original permissions of the file;-T indicates retaining the original time of the file; -G indicates the original user group of the file,-O indicates the original owner of
local directory can be defined by yourself. For example, dave can also. When you do not have the "David home" directory on the client, the system will automatically create one for you. If the directory David home exists, pay attention to its write permission.
Note:-A parameter is equivalent to-rlptgoD.-r indicates recursive-l indicates a link file, which means copying a link file;-p indicates retaining the original permissions of the file;-t indicates retaining the original time of the file; -g
original time of the file; -g indicates the original user group of the file,-o indicates the original owner of the file, and-D indicates a block device file;-Z compression during transmission;-P transmission progress;-V transmission progress and other information. It has something to do with-P. Try it on your own. You can see the document;
Scenario 2:# Rsync-avz
file is time-stamped with the time Stamp window, which defaults to 0-t--temp-dir=dir creating temporary files in Dir--compare-dest=dir also compares the files in DIR to determine if a backup is required-p equivalent to--partial--progress Show Backup process-Z,--compress compress the backed-up files during transmission--exclude=pattern specify to exclude file modes that do not need to be transferred--include=pattern specifies file modes that need to b
1. Using Ssh+rsyncYou only need to open the SSH service on the server side and start the rsync service in xinetd to useA. Incremental synchronizationrsync-av/src-dir/. [email protected]:/dest-dir/.B. Mirroring synchronizationRsync-av--delete/src-dir/. [email protected]:/dest-dir/.Features: Simple configuration, no need to configure rsyncd.conf profile, but requires user authentication during synchronizationNote: You can create an auto-sync encryption
1.RSYNC: Remote sync, support local replication, or synchronize with other SSH and RSYNC hosts.Rsync remote synchronization and CP, SCP function basically consistent, the other two is to copy the source files, if there is new data added, using CP, SCP to the source file all the content is copied, and Rsync is on the basis of the source files only update the newly
permissions;-T to keep the file original user group;-O Keep the original owner of the file;-D is equivalent to the block device file;-Z compression during transmission;-P transmission progress;-V Transfer progress and other information, and-p a little relationship, try it yourself. can read the document;Scenario Two:# RSYNC-AVZP--delete [email protected]::d Avid
xinetd-y]
2. Start the rsync dependency service
[/Etc/init. d/xinetd start]
[Chkconfig xinetd on]
3. the password file must be configured on the client.
[Vi/etc/rsync. pas]
123456 # consistent with the user password on the server !!
Chmod 600/etc/rsync. pas # Same server license
4. Run the following command on the client to synchronize data:
Download (obtain ):
rsync server. This mode is started when the DST path information contains the "::" separator.6. List of files for remote machines. This is similar to rsync transmission, but simply omitting the local machine information in the command.-A operates in archive mode, replicates directories, symbolic connections equivalent to-rlptgod
Parameters in Rsync
-R is recursi
32nd-foundation of rsync advanced synchronization tool, 32nd-rsync
Directory:
1. rsync Introduction2. How rsync works3. Use the rsync command. parameter description4. install and configure the rsync server on the client1. Server i
Rsync architecture and rsync Architecture
1.1 rsync server configuration
1.1.1 view the server rsync version
1.1.2 after the rsync program is installed by default, the main configuration file of rsync is not automatically creat
,-avz equivalent to-vzrtopgD1, the file and directory attributes remain unchanged during synchronization. 2.-P indicates the synchronization process. you can replace it with -- progress. 3.-e "ssh-p 22" indicates data transmission through the ssh channel.-p 22 can be omitted. 4. lianglab@192.168.1.110:/opt remote host system user, address, path 5,/tmp local path. Instance: use the root user from 192. The opt directory (including the directory itself)
permissions;-T to keep the file original user group;-O Keep the original owner of the file;-D is equivalent to the block device file;-Z compression during transmission;-P transmission progress;-V Transfer progress and other information, and-p a little relationship, try it yourself. can read the document;Scenario Two:# RSYNC-AVZP--delete [email protected]::d Avid
file, do not use the default rsyncd.conf file--port=port Specify a different rsync service port--blocking-io using blocking IO for remote shells-stats gives the transfer status of some files--progress in the transmission of the real-time transmission process--log-format=format specifying the log file format--password-file=file get the password from file--bwlimit=kbps limit I/O bandwidth, Kbytes per second-
shell mode, it uses ssh to perform underlying connections and encrypted transmission. The third is the query mode, which is similar to the functions implemented by the ls command. The fourth mode is the server mode. Generally, rsync server Construction refers to this mode. Rsync with ssh channel technology case # rsync-avzP/etc/hosts-e "ssh-p30000" lianglab@192.
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.