美文网首页
Rsync:1.命令参数

Rsync:1.命令参数

作者: 小六的昵称已被使用 | 来源:发表于2019-05-12 10:02 被阅读0次

环境

[root@centos181003 ~]# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)

[root@centos181003 ~]# rsync --version
rsync  version 3.1.2  protocol version 31

命令选项

[root@centos181003 ~]# rsync --help
rsync  version 3.1.2  protocol version 31
Copyright (C) 1996-2015 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes, prealloc

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

rsync is a file transfer program capable of efficient remote update
via a fast differencing algorithm.

Usage: rsync [OPTION]... SRC [SRC]... DEST
  or   rsync [OPTION]... SRC [SRC]... [USER@]HOST:DEST
  or   rsync [OPTION]... SRC [SRC]... [USER@]HOST::DEST
  or   rsync [OPTION]... SRC [SRC]... rsync://[USER@]HOST[:PORT]/DEST
  or   rsync [OPTION]... [USER@]HOST:SRC [DEST]
  or   rsync [OPTION]... [USER@]HOST::SRC [DEST]
  or   rsync [OPTION]... rsync://[USER@]HOST[:PORT]/SRC [DEST]
The ':' usages connect via remote shell, while '::' & 'rsync://' usages connect
to an rsync daemon, 
':'用法通过远程shell连接,而'::'和'rsync://'用法连接到rsync守护进程,
and require SRC or DEST to start with a module name.
并要求SRC或DEST以模块名称开头。

Options
 -v, --verbose               increase verbosity
                                增加冗长

     --info=FLAGS            fine-grained informational verbosity
                                细粒度的信息冗长

     --debug=FLAGS           fine-grained debug verbosity
                                细粒度的调试详细程度

     --msgs2stderr           special output handling for debugging
                                用于调试的特殊输出处理

 -q, --quiet                 suppress non-error messages
                                抑制非错误消息

     --no-motd               suppress daemon-mode MOTD (see manpage caveat)
                                抑制守护进程模式MOTD(参见手册警告)

 -c, --checksum              skip based on checksum, not mod-time & size
                                基于校验和跳过,而不是模态时间和大小

 -a, --archive               archive mode; equals -rlptgoD (no -H,-A,-X)
                                存档模式

     --no-OPTION             turn off an implied OPTION (e.g. --no-D)
                                关闭隐含的OPTION

 -r, --recursive             recurse into directories
                                递归目录

 -R, --relative              use relative path names
                                使用相对路径名称

     --no-implied-dirs       don't send implied dirs with --relative
                                不要用--relative发送暗示的目录

 -b, --backup                make backups (see --suffix & --backup-dir)
                                进行备份

     --backup-dir=DIR        make backups into hierarchy based in DIR
                                备份目录

     --suffix=SUFFIX         set backup suffix (default ~ w/o --backup-dir)
                                设置备份后缀

 -u, --update                skip files that are newer on the receiver
                                跳过接收器上较新的文件

     --inplace               update destination files in-place (SEE MAN PAGE)
                                就地更新目标文件(SEE MAN PAGE)

     --append                append data onto shorter files
                                将数据附加到较短的文件中

     --append-verify         like --append, but with old data in file checksum
                                像--append,但文件校验和中的旧数据

 -d, --dirs                  transfer directories without recursing
                                传输目录而不递归

 -l, --links                 copy symlinks as symlinks
                                将符号链接复制为符号链接

 -L, --copy-links            transform symlink into referent file/dir
                                将符号链接转换为引用文件/目录

     --copy-unsafe-links     only "unsafe" symlinks are transformed
                                只有“不安全”的符号链接才会被转换

     --safe-links            ignore symlinks that point outside the source tree
                                忽略指向源树外部的符号链接

     --munge-links           munge symlinks to make them safer (but unusable)
                                munge符号链接使它们更安全(但无法使用)

 -k, --copy-dirlinks         transform symlink to a dir into referent dir
                                将符号链接转换为dir到referent目录

 -K, --keep-dirlinks         treat symlinked dir on receiver as dir
                                将接收器上的符号链接目录视为目录

 -H, --hard-links            preserve hard links
                                保留硬链接

 -p, --perms                 preserve permissions
                                保留权限

 -E, --executability         preserve the file's executability
                                保留文件的可执行性

     --chmod=CHMOD           affect file and/or directory permissions
                                影响文件和/或目录权限

 -A, --acls                  preserve ACLs (implies --perms)
                                保留ACL

 -X, --xattrs                preserve extended attributes
                                保留扩展属性

 -o, --owner                 preserve owner (super-user only)
                                保留所有者(仅限超级用户)

 -g, --group                 preserve group
                                保留组

     --devices               preserve device files (super-user only)
                                保留设备文件(仅限超级用户)

     --copy-devices          copy device contents as regular file
                                将设备内容复制为常规文件

     --specials              preserve special files
                                保留特殊文件

 -D                          same as --devices --specials
                                等于:--devices --specials

 -t, --times                 preserve modification times
                                保留修改时间

 -O, --omit-dir-times        omit directories from --times
                                从--times中省略目录

 -J, --omit-link-times       omit symlinks from --times
                                从--times中省略符号链接

     --super                 receiver attempts super-user activities
                                接收器尝试超级用户活动

     --fake-super            store/recover privileged attrs using xattrs
                                使用xattrs存储/恢复特权attrs

 -S, --sparse                handle sparse files efficiently
                                有效地处理稀疏文件

     --preallocate           allocate dest files before writing them
                                在写入之前分配dest文件

 -n, --dry-run               perform a trial run with no changes made
                                执行试运行而不进行任何更改

 -W, --whole-file            copy files whole (without delta-xfer algorithm)
                                整个文件复制(没有delta-xfer算法)

 -x, --one-file-system       don't cross filesystem boundaries
                                不要跨文件系统边界

 -B, --block-size=SIZE       force a fixed checksum block-size
                                强制一个固定的校验和块大小

 -e, --rsh=COMMAND           specify the remote shell to use
                                指定要使用的远程shell

     --rsync-path=PROGRAM    specify the rsync to run on the remote machine
                                指定要在远程计算机上运行的rsync

     --existing              skip creating new files on receiver
                                跳过在接收器上创建新文件

     --ignore-existing       skip updating files that already exist on receiver
                                跳过更新接收器上已存在的文件
                                
     --remove-source-files   sender removes synchronized files (non-dirs)
                                发件人删除同步文件(非dirs)

     --del                   an alias for --delete-during
                                --delete-during的别名

     --delete                delete extraneous files from destination dirs
                                从目标目录删除无关文件

     --delete-before         receiver deletes before transfer, not during
                                接收者在转移前删除,而不是在转移期间

     --delete-during         receiver deletes during the transfer
                                接收者在转移期间删除

     --delete-delay          find deletions during, delete after
                                在删除期间,删除之后删除

     --delete-after          receiver deletes after transfer, not during
                                接收者在转移后删除,而不是在转移期间

     --delete-excluded       also delete excluded files from destination dirs
                                还删除目标目录中的排除文件

     --ignore-missing-args   ignore missing source args without error
                                忽略缺少的源args而不会出错

     --delete-missing-args   delete missing source args from destination
                                从目标中删除缺少的源args

     --ignore-errors         delete even if there are I/O errors
                                即使存在 I/O 错误也会删除

     --force                 force deletion of directories even if not empty
                                强制删除目录,即使不是空的

     --max-delete=NUM        don't delete more than NUM files
                                不要删除超过NUM个文件

     --max-size=SIZE         don't transfer any file larger than SIZE
                                不要传输任何大于SIZE的文件

     --min-size=SIZE         don't transfer any file smaller than SIZE
                                不要传输任何小于SIZE的文件

     --partial               keep partially transferred files
                                保留部分传输的文件

     --partial-dir=DIR       put a partially transferred file into DIR
                                将部分传输的文件放入DIR

     --delay-updates         put all updated files into place at transfer's end
                                将所有更新的文件放在传输结束时

 -m, --prune-empty-dirs      prune empty directory chains from the file-list
                                修剪文件列表中的空目录链

     --numeric-ids           don't map uid/gid values by user/group name
                                    不要按 uid/gid 映射 user/group

     --usermap=STRING        custom username mapping
                                自定义用户名映射

     --groupmap=STRING       custom groupname mapping
                                自定义组名映射

     --chown=USER:GROUP      simple username/groupname mapping
                                简单的 username/groupname 映射

     --timeout=SECONDS       set I/O timeout in seconds
                                以秒为单位设置 I/O 超时

     --contimeout=SECONDS    set daemon connection timeout in seconds
                                以秒为单位设置守护程序连接超时

 -I, --ignore-times          don't skip files that match in size and mod-time
                                不要跳过大小匹配的文件和以秒为单位的mod-timeon连接超时

 -M, --remote-option=OPTION  send OPTION to the remote side only
                                仅将OPTION发送到远程端

     --size-only             skip files that match in size
                                跳过大小匹配的文件

     --modify-window=NUM     compare mod-times with reduced accuracy
                                比较模态时间与精度降低

 -T, --temp-dir=DIR          create temporary files in directory DIR
                                在目录DIR中创建临时文件

 -y, --fuzzy                 find similar file for basis if no dest file
                                如果没有dest文件,找到类似的文件

     --compare-dest=DIR      also compare destination files relative to DIR
                                还比较目标文件相对于DIR

     --copy-dest=DIR         ... and include copies of unchanged files
                                并包含未更改文件的副本

     --link-dest=DIR         hardlink to files in DIR when unchanged
                                硬盘链接到DIR文件时保持不变

 -z, --compress              compress file data during the transfer
                                在传输过程中压缩文件数据

     --compress-level=NUM    explicitly set compression level
                                明确设置压缩级别

     --skip-compress=LIST    skip compressing files with a suffix in LIST
                                跳过在LIST中压缩带后缀的文件

 -C, --cvs-exclude           auto-ignore files the same way CVS does
                                自动忽略文件的方式与CVS相同

 -f, --filter=RULE           add a file-filtering RULE
                                添加文件过滤规则

 -F                          same as --filter='dir-merge /.rsync-filter'
                                等同于:--filter='dir-merge /.rsync-filter'

                             repeated: --filter='- .rsync-filter'

     --exclude=PATTERN       exclude files matching PATTERN
                                排除匹配PATTERN的文件

     --exclude-from=FILE     read exclude patterns from FILE
                                从FILE读取排除模式

     --include=PATTERN       don't exclude files matching PATTERN
                                不要排除匹配PATTERN的文件

     --include-from=FILE     read include patterns from FILE
                                读取包含来自FILE的模式

     --files-from=FILE       read list of source-file names from FILE
                                从FILE中读取源文件名列表

 -0, --from0                 all *-from/filter files are delimited by 0s
                                所有 *-from/filter 文件都以0分隔

 -s, --protect-args          no space-splitting; only wildcard special-chars
                                没有空间分裂; 只有通配符特殊字符

     --address=ADDRESS       bind address for outgoing socket to daemon
                                将传出套接字的地址绑定到守护程序

     --port=PORT             specify double-colon alternate port number
                                指定双冒号备用端口号

     --sockopts=OPTIONS      specify custom TCP options
                                指定自定义TCP选项

     --blocking-io           use blocking I/O for the remote shell
                                使用阻塞 I/O 进行远程shell

     --stats                 give some file-transfer stats
                                给出一些文件传输统计信息

 -8, --8-bit-output          leave high-bit chars unescaped in output
                                留下高位字符未输出

 -h, --human-readable        output numbers in a human-readable format
                                以人类可读的格式输出数字

     --progress              show progress during transfer
                                转移期间显示进度

 -P                          same as --partial --progress
                                等同于:--partial --progress

 -i, --itemize-changes       output a change-summary for all updates
                                输出所有更新的更改摘要

     --out-format=FORMAT     output updates using the specified FORMAT
                                使用指定的FORMAT输出更新

     --log-file=FILE         log what we're doing to the specified FILE
                                记录我们对指定的FILE所做的事情

     --log-file-format=FMT   log updates using the specified FMT
                                使用指定的FMT记录更新

     --password-file=FILE    read daemon-access password from FILE
                                从FILE读取守护程序访问密码

     --list-only             list the files instead of copying them
                                列出文件而不是复制它们

     --bwlimit=RATE          limit socket I/O bandwidth
                                限制套接字 I/O 带宽

     --outbuf=N|L|B          set output buffering to None, Line, or Block
                                将输出缓冲设置为None,Line或Block

     --write-batch=FILE      write a batched update to FILE
                                写一个批量更新到FILE

     --only-write-batch=FILE like --write-batch but w/o updating destination
                                喜欢--write-batch但没有更新目的地

     --read-batch=FILE       read a batched update from FILE
                                从FILE读取批量更新

     --protocol=NUM          force an older protocol version to be used
                                强制使用较旧的协议版本

     --iconv=CONVERT_SPEC    request charset conversion of filenames
                                请求charset转换文件名

     --checksum-seed=NUM     set block/file checksum seed (advanced)
                                设置 block/file  件校验和种子(高级)

 -4, --ipv4                  prefer IPv4
 -6, --ipv6                  prefer IPv6
     --version               print version number
(-h) --help                  show this help (-h is --help only if used alone)

Use "rsync --daemon --help" to see the daemon-mode command-line options.
Please see the rsync(1) and rsyncd.conf(5) man pages for full documentation.
See http://rsync.samba.org/ for updates, bug reports, and answers

守护进程

[root@centos181003 ~]# rsync --daemon --help
rsync  version 3.1.2  protocol version 31
Copyright (C) 1996-2015 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes, prealloc

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

Usage: rsync --daemon [OPTION]...
     --address=ADDRESS       bind to the specified address
                                绑定IP

     --bwlimit=RATE          limit socket I/O bandwidth
                                限制套接字 I/O 带宽

     --config=FILE           specify alternate rsyncd.conf file
                                指定备用rsyncd.conf文件

 -M, --dparam=OVERRIDE       override global daemon config parameter
                                覆盖全局守护程序配置参数

     --no-detach             do not detach from the parent
                                不要与父母分离

     --port=PORT             listen on alternate port number
                                监听端口

     --log-file=FILE         override the "log file" setting
                                覆盖“日志文件”设置

     --log-file-format=FMT   override the "log format" setting
                                覆盖“日志格式”设置

     --sockopts=OPTIONS      specify custom TCP options
                                指定自定义TCP选项

 -v, --verbose               increase verbosity
                                增加详细程度

 -4, --ipv4                  prefer IPv4
 -6, --ipv6                  prefer IPv6
     --help                  show this help screen

If you were not trying to invoke rsync as a daemon, avoid using any of the
daemon-specific rsync options.  See also the rsyncd.conf(5) man page.
如果您没有尝试将rsync作为守护程序调用,请避免使用任何一个守护程序特定的rsync选项。

相关文章

  • Rsync:1.命令参数

    环境 命令选项 守护进程

  • rsyncd制作备份服务器

    1. rsync服务端 2. 客户端配置 3. rsync命令参数详细说明

  • rsync参数

    rsync命令参数详细说明 rsync守护进程名称语法:

  • 2019-08-13

    day31 综合架构备份服务章节 课程介绍 1. rsync备份服务传输数据原理2. rsync备份服务命令参数说...

  • day 31综合架构备份服务章节

    课程介绍 rsync守护进程模式备份数据原理 错误说明: rsync命令参数说明 rsync守护进程备份服务企业应...

  • 8月13日 rsync

    rsync守护进程模式备份数据原理 (用户身份转换过程) rsync命令参数说明 补充: 客户端部署过程(rsyn...

  • 4-10.1 Linux 中的文件同步传输 --- rsync

    本地使用 rsync 进行传输,熟悉 rsync 常用参数功能 。 4-10-1 内容:1、rsync 不加参数传...

  • rsync与rsyslogd

    rsync命令基本语法 rsync的命令格式可以分为以下6种:rsync [OPTION]... SRC DEST...

  • rsync后台保持运行

    ` 1.正常执行scp/rsync命令 注意rsync 需要ps uxf查看 输入密码后,子进程 ssh 与rsy...

  • CentOS7之系统设置

    常用工具安装 1. 安装 vim 2. 安装 rsync(同步命令) rsync用法示例: tips:目标服务器也...

网友评论

      本文标题:Rsync:1.命令参数

      本文链接:https://www.haomeiwen.com/subject/jknqaqtx.html