Linux Rsync data image and backup steps 1: Install rsync to download the latest rsync package. Find the latest package at http://rsync.samba.org/rsync. You can use the rpm package for installation. I have applied the source code here. For some reason, I prefer to install the source code. # Wget-c http://rsync.samba.org/ftp/rsync/src/rsync-3.0.3.tar.gz # tar zxf rsync-3.0.3.tar.gz # cd rsync-3.0.3 # less INSTALL # first check the Installation File #. /configure # make install Step 2: Set the producer to create two files:/etc/rsyncd. conf and/etc/rsyncd. pwd # cat/etc/rsyncd. confuid = rootgid = systemuse chroot = nomax connections = 10pid file =/var/run/rsyncd. pidlock file =/var/run/rsync. locklog file =/var/log/rsyncd. log [dfile] Path =/dfile/comment = data fileignore errorsread only = truelist = falseuid = 0gid = 0 secrets file =/etc/rsyncd. note that you need to create/var/run directory for pwd. Otherwise, the task cannot be started. # Cat/etc/rsyncd. pwddfile: dfilepassword # chmod 600/etc/rsyncd. pwd (required !) Step 3: Start the worker to run at the event side # rsync-daemon. You can use ps-ef | grep rsync, netstat-na | grep 873 to check whether the task is started. If it is not started, check/var/log/rsyncd. log. Step 4: create a shell file on the client: # cat/var/rsync. shrsync-zvrtopg -- delete -- password-file =/etc/rsyncd. pwd/dfile/# chmod + x/var/rsync. sh allows the preceding shell file to verify whether file synchronization can be performed. Correct/etc/crontab settings for timed synchronization, for example: # echo "***/var/rsync. sh ">/etc/crontab is set to synchronize every 30 minutes. Rsync Parameter Details option analysis-v, -- verbose specific mode output-q, -- quiet simplified output mode-c, -- checksum turn on the verification switch, forcing the file transfer Validation-, -- archive mode, indicating that the file is transmitted recursively and all file attributes are maintained.-rlptgoD-r, -- recursive processes the reward and punishment-R in recursive mode for the sub-directories, -- relative application relative path information rsync foo/bar/foo. c remote:/tmp/create foo in the/tmp directory. c file, and if the application-R parameter: rsync-R foo/bar/foo. c remote:/tmp/will create the file/tmp/foo/bar/foo. c, that is, it will maintain the complete path information. -B, -- backup creates a backup, that is, when the same file name already exists in the rule, rename the old file ~ Filename. You can use the -- suffix option to specify different backup file prefixes. -- Backup-dir: backs up files (for example ~ Filename) is stored in the directory. -Suffix = SUFFIX indicates the backup file prefix-u. -- update only supports updates, that is, skipping all files that already exist in DST and whose time is later than the backup time. (Do not overwrite the updated file)-l, -- links career soft link-L, -- copy-links: process soft links like old files -- copy-unsafe-links: Just copy links other than the SRC path directory tree -- safe-links ignores the contents pointing to the SRC path. link other than tree-H, -- hard-links hard link-p, -- perms maintains File permissions-o, -- owner maintains file owner information-g, -- group maintains file owner information-D, -- devices: maintenance equipment file information-t, -- times: maintenance of file time information-S, -- sparse: Promotion of rare files; Rewards and Punishments: Diligent DST space-n, -- dry-run which files will be transmitted-W, -- whole-file to copy files, without incremental detection-x, -- one-file-system: do not exceed the file system boundary-B. -- block-size = SIZE: Check the block size of the algorithm application. The default value is 700 bytes-e, -- rsh = COMMAND specifies the shell action to replace rsh -- rsync-path = PATH specifies the rsync COMMAND location on the long-distance worker-C, -- the cvs-exclude application actively ignores files like CVS to remove files that are not eager to be transmitted -- existing only updates files that already exist in DST, instead of backing up those new files -- delete those files that are not in the dst src -- delete-excluded also delete the files that are released by this option on the terminal -- delete-after transmission ends delete later -- ignore-errors will be deleted when I/o errors occur in a timely manner -- max-delete = NUM will delete up to NUM files -- partial files that are not completely transmitted for some reason, in order to speed up subsequent re-transmission-force forces the deletion of contents, even if it is not blank -- numeric-ids does not match the number user and group ID as the user name and group 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 files, only observe the file size, without thinking about the file time -- modify-window = NUM determine whether the file has the same time when the timestamp window is applied, the default value is 0-T -- temp-dir = DIR. Create a temporary file in DIR -- compare-dest = DIR. Similarly, it matches the file in DIR to determine whether backup is required.-P is equivalent to -- partial -- progress represents the backup process-z, -- compress provides a penalty for tightening the backup file during transmission -- exclude = PATTERN specifies the file mode for removing unnecessary transmission -- include = PATTERN specifies the file mode that is not removed and must be transmitted -- exclude -from = FILE: Remove files in the specified mode in FILE -- include-from = FILE: Do not unbind files in the specified mode. -- print version information -- address: bind the FILE to a specific location. -- config = FILE to specify other settings files, do not apply the default rsyncd. conf file -- port = PORT specify other rsync ports -- blocking-io for long-distance shell application blocking IO-stats to give the transmission status of some files -- progress actual transmission process during transmission -- log-format = FORMAT specify the two log files -- password-file = FILE get the password from the FILE -- bwlimit = KBPS limit I/O bandwidth, KBytes per second-h, -- help represents sponsorship Information