Linux Rsync data mirroring and backup

Source: Internet
Author: User
Linux Rsync data Image and backup steps 1: install rsync to download the latest rsync package, the latest package in http://rsync.samba.org/rsync Find it. 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... linux Rsync data Image and backup steps 1: install rsync to download the latest rsync package, the latest package in http://rsync.samba.org/rsync Find it. 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. pwd pay attention to the need to create/var/run contents, otherwise the work cannot start. # 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
Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.