`
baiguomeng
  • 浏览: 956568 次
文章分类
社区版块
存档分类
最新评论

rsync - 客户端常用参数

 
阅读更多

rsync - 客户端常用参数

# -a, --archive
# This is equivalent to -rlptgoD. It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when --files-from is specified, in which case -r is not implied.
# 等价于-rlptgoD。简言之即是想最大限度的保留所有事物(值得注意的是忽略了-H)。仅在指定了--files-from时不等价,此时不执行-r。
# -r, --recursive
# This tells rsync to copy directories recursively. See also --dirs (-d).
# 通知rsync递归复制文件夹。参见 --dirs (-d)。
# -u, --update
# This forces rsync to skip any files which exist on the destination and have a modified time that is newer than the source file. (If an existing destination file has a modification time equalto the source file's, it will be updated if the sizes are different.)
# 强制rsync跳过目标上已存在而且比源文件新的任何文件。(如果一个已存在的目标文件的修改时间和源文件相等,则在尺寸不同时更新)
# -l, --links
# When symlinks are encountered, recreate the symlink on thedestination.
# 在遇到符号链接时,在目标上重建符号链接
# -p, --perms
# This option causes the receiving rsync to set the destination permissions to be the same as the source permissions. (See also the --chmod option for a way to modify what rsync considers to be the source permissions.)
# 该选项导致rsync接收方按照和源相同的权限设置目标权限。(参见--chmod选项提供一个途径修改rsync如何判断源权限。)
# -o, --owner
# This option causes rsync to set the owner of the destination file to be the same as the source file, but only if the receiving rsync is being run as the super-user (see also the --super and --fake-super options). Without this option, the owner of new and/or transferred files are set to the invoking user on the receiving side.
# 该选项导致rsync按照源文件设置目标文件相同的owner,但是仅限于rsync接收方运行于超级用户时(参考--super和--fake-super选项)。没有该选项时,新建和/或已传输文件的owner将设置为接收端运行的帐户。
# -g, --group
# This option causes rsync to set the group of the destination file to be the same as the source file. If the receiving program is not running as the super-user (or if --no-super was specified), only groups that the invoking user on the receiving side is a member of will be preserved. Without this option, the group is set to the default group of the invoking user on the receiving side.
# 该选项导致rsync按照源文件设置目标文件相同的group,如果接收程序没有使用超级用户运行(或者指定--no-super)时,仅在接收方的执行用户是group的成员时才能保留。没有该选项时,group设置为接收端执行用户的默认组。
# -t, --times
# This tells rsync to transfer modification times along with the files and update them on the remote system. Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective; in other words, a missing -t or -a will cause the next transfer to behave as if it used -I, causing all files to be updated (though rsync's deltatransfer algorithm will make the update fairly efficient if the files haven't actually changed, you're much better off using -t).
# 通知rsync在传输文件时也传输最后修改日期并更新到远程系统。注意如果不使用该选项,则排除没有修改的文件的优化方式将不起作用,换句话说,缺少-t 或-a将导致下一次传输时像设置了-I一样,导致更新所有的文件(尽管在文件没有实际改变时rsync的增量传输算法也将提升更新效率,最好使用-t)。
# -z, --compress
# With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection.
# 使用该选项,rsync在发送到目标设备前压缩文件数据,这将减少传输文件的数量——对于慢速连接有用处
# 例如远程可用如下参数
/usr/bin/rsync -auz192.168.1.2::module /path/to/module/
# 本地可以用如下参数
/usr/bin/rsync -au/path/to/source/ /path/to/destination/

[相关问题]

全局常用配置说明

模块常用配置说明

客户端常用参数

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics