rsync
常用选项
-v
: Verbose (try -vv for more detailed information) # 详细模式显示-e
"ssh options" : specify the ssh as remote shell # 指定ssh作为远程shell-a
: archive mode # 归档模式,表示以递归方式传输文件,并保持所有文件属性,等于-rlptgoD-r
(--recursive) : 目录递归-l
(--links) :保留软链接-p
(--perms) :保留文件权限-t
(--times) :保留文件时间信息-g
(--group) :保留属组信息-o
(--owner) :保留文件属主信息-D
(--devices) :保留设备文件信息
-z
: 压缩文件-h
: 以可读方式输出-H
: 复制硬链接-X
: 保留扩展属性-A
: 保留ACL属性-n
: 只测试输出而不正真执行命令,推荐使用,特别防止--delete
误删除!--stats
: 输出文件传输的状态--progress
: 输出文件传输的进度––exclude=PATTERN
: 指定排除一个不需要传输的文件匹配模式––exclude-from=FILE
: 从 FILE 中读取排除规则––include=PATTERN
: 指定需要传输的文件匹配模式––include-from=FILE
: 从 FILE 中读取包含规则--numeric-ids
: 不映射 uid/gid 到 user/group 的名字-S, --sparse
: 对稀疏文件进行特殊处理以节省DST的空间--delete
: 删除DST中SRC没有的文件,也就是所谓的镜像[mirror]备份
三、远程 Shell 方式
参考:
https://linuxwiki.github.io/Services/rsync.html