Linux rsync command detailed finishing

  
                  After the rsync server configuration is complete, the next step is to issue the rsync command on the client to back up the server-side files to the client. Rsync is a very powerful tool, and its commands also have a lot of features. Let's analyze the options one by one. The Rsync command format can be as follows: rsync [OPTION]... SRC DEST rsync [OPTION]... SRC [USER@]HOST:DEST rsync [OPTION]... [USER@]HOST:SRC DEST rsync [OPTION]... [USER@]HOST::SRC DEST rsync [OPTION]... SRC [USER@]HOST::DEST rsync [OPTION]... rsync://[USER@]HOST[:PORT ]/SRC [DEST] Corresponds to the above six command formats, rsync has six different working modes: 1) Copy local files. This mode of operation is initiated when neither the SRC nor the DES path information contains a single colon ":" separator. Such as: rsync -a /data /backup 2) Use a remote shell program (such as rsh, ssh) to copy the contents of the local machine to the remote machine. This mode is initiated when the DST path address contains a single colon ":" separator. Such as: rsync -avz *.c foo: src 3) Use a remote shell program (such as rsh, ssh) to copy the contents of the remote machine to the local machine. This mode is initiated when the SRC address path contains a single colon ":" separator. For example: rsync -avz foo:src/bar /data 4) Copy files from the remote rsync server to the local machine. This mode is initiated when the SRC path information contains a "::" separator. For example: rsync -av [email protected]::www /databack 5) Copy files from the local machine to the remote rsync server. This mode is initiated when the DST path information contains a "::" separator. For example: rsync -av /databack [email protected]::www 6) List the files of the remote machine. This is similar to rsync transfer, but just omit the local machine information in the command. For example: rsync -v rsync://172.16.78.192/wwwrsync parameters are explained as follows: -v, --verbose Detailed mode output -q, --quiet Reduced output mode -c, --checksum Turn on the check switch, force Verify file transfer -a, --archive archive mode, means recursively transfer files and keep all file attributes equal to -rlptgoD-r, --recursive handles subdirectories in recursive mode -R, --relative Use the relative path information -b, --backup to create a backup, that is, rename the old file to ~filename when the same file name already exists for the purpose. You can use the --suffix option to specify a different backup file prefix. --backup-dir Stores backup files (such as ~filename) in the directory. -suffix=SUFFIX Defines the backup file prefix -u, --update to update only, that is, skip all files that already exist in DST, and the file time is later than the file to be backed up. (Do not overwrite updated files) -l, --links Retain soft links -L, --copy-links Treat soft links like regular files --copy-unsafe-links Copy only points outside the SRC path directory tree The link --safe-links ignores the link to the SRC path directory tree -H, --hard-links keeps the hard link -p, --perms keeps file permissions -o, --owner keeps the file owner information - g, --group keep file group information -D, --devices keep device file information -t, --times keep file time information -S, --sparse Special processing of sparse files to save DST space -n, --dry-run which files will be transferred -W, --whole-file copy files, no incremental detection -x, --one-file-system Do not cross file system boundaries -B, --block-size =SIZE Checks the block size used by the algorithm. The default is 700 bytes -e, --rsh=COMMAND specifies the use of rsh, ssh for data synchronization --rsync-path=PATH Specifies the path information of the rsync command on the remote server -C , --cvs-exclude automatically ignores files in the same way as CVS, to exclude files that you don't want to transfer --existing just New files that already exist in DST, but not those newly created files -- delete delete files that are not available in SRC in DST -- delete-excluded Also delete files on the receiving end that are excluded by this option --delete-after Delete after the end of the transfer --ignore-errors IO errors are also deleted in time - max-delete=NUM deletes up to NUM files --partial keeps files that have not been completely transferred for any reason, so as to speed up subsequent retransmissions - -force Forces deletion of directories, even if not null --numeric-ids does not match numeric user and group IDs to username and group name --timeout=TIME IP timeout in seconds -I, --ignore-times Skip files that have the same amount of time and length --size-only When deciding whether to back up a file, just look at the file size regardless of the file time --modify-window=NUM Determines whether the file is timed with the same timestamp Window, default is 0-T --temp-dir=DIR Create a temporary file in DIR --compare-dest=DIR Also compare the files in DIR to determine whether you need to back up -P is equivalent to --partial--progress Procedure -z, --compress Compresses the backed up files at the time of transmission --exclude=PATTERN Specifies to exclude file patterns that do not need to be transferred -- include=PATTERN Specifies the file mode that needs to be transferred without exclusion --exclude-from= FILE excludes the file specified in FILE--include-from=FILE does not exclude FILE specified pattern matching file --version print version information --address bind to a specific address --config=FILE specify other configuration file, no Use the default rsyncd.conf file --port=PORT to specify other rsync service ports --blocking-io to use the blocking IO-stats for remote shells to give the transfer status of certain files --progress during the transfer of the actual transfer process -- Log-format=formAT Specify the log file format --password-file=FILE Get the password from FILE--bwlimit=KBPS Limit I/O bandwidth, KBytes per second-h, --help Display help information
Copyright © Windows knowledge All Rights Reserved