我在网上find一篇文章,提供了如何使用rsync备份专用服务器的说明。
在本文的其中一个步骤中,我应该创build一个名为“rsync”的用户并为其添加sudo权限。 一切进展顺利,但“rsync”用户的visudo选项很难理解。 “/ usr / bin / rsync”命令的某些选项在Internet上几乎没有文档。
以下是我所说的visudo线:
rsync ALL=(ALL) NOPASSWD: /usr/bin/rsync --server --sender -logDtprze.iLsf --numeric-ids . /
首先,我了解“–server – sender”属性。 什么是真正的烦扰我是选项“-logDtprze.iLsf”。
我有一个CentOS服务器,当我运行命令“man rsync”时,rsync文档中没有这个选项。 其实,每次我尝试在visudo中使用这个选项,没有任何工作。
我最终发现对“-logDtprze.iLsf”的模糊引用是Debian中rsync的新特性。 我不确定。
我只是想知道这个选项是做什么的,如果可以在我的备份设置中忽略它。
我也想了解行末“斜线”的目的。“/”
编辑:谢谢bodgit! 我觉得自己像个白痴! 🙂
这是简短的选项-l , -o , -g , -D等,而不是单独拼出它们可以折叠,这是大多数Unix工具的标准行为,即rm -rf与rm -r -f相同。
我做了一些调查,并find了参数“-logDtprze.iLsf”序列中每个字母的含义
-l, --links copy symlinks as symlinks -o, --owner preserve owner (super-user only) -g, --group preserve group -D, --devices transfer character and block device files -t, --times preserve modification times -p, --perms preserve permissions -r, --recursive copy directories recursively -z, --compress compresses data as it is sent to the destination -e, --rsh=COMMAND allows to choose an alternative remote shell program . -i, --itemize-changes show list of changes being made to each file -L, --copy-links transform symlink into referent file/dir -s, --protect-args no space-splitting; wildcard chars only -f, --filter=RULE allows to add rules to exclude certain files
我唯一无法理解的就是这段时间的意义。“ 在参数的中间。