Use the rsync command to synchronize data-Linux Enterprise Application-Linux server application information. The following is a detailed description. Considering server data security, I want to add a backup server to achieve better redundancy through data synchronization.
In linux, there is a very good command rsync to implement differential backup. The following describes its usage:
▲Suitable system: Hongqi DC 4.1 or 5.0, or other linux and FreeBSD systems
▲Test environment: Hongqi DC 5.0
1. Use rsh or ssh commands
In the absence of an rsync server, we can use the rsync command to directly perform fast differential backup:
CODE: Command Format:
# Rsync [option] Destination path of the Source Path
Where:
[Option]:
A: Use the archive mode, which is equal to-rlptgoD, that is, keep the original file permission.
Z: Indicates compressed data during transmission.
V: display to the screen
E: Use a remote shell program (rsh or ssh can be used)
-- Delete: Precisely saves copies. files deleted from the source host are also deleted from the target host.
-- Include = PATTERN: do not exclude files or directories that conform to PATTERN.
-- Exclude = PATTERN: exclude all files or directories that conform to the PATTERN.
-- Password-file: Specifies the password used for rsync server user authentication.
The Source Path and target path can be in the following format:
Rsync: // [USER @] Host [: Port]/Path <-- rsync server Path
[USER @] Host: Path <-- another representation of rsync server
[USER @] Host: Path <-- remote Path
LocalPath <-- local path |