Which of the following commands will securely copy the directory ./fyf/ to /var/tmp/ on the remote host deltaur using the remote user account kevin?
A.
rsync -a -e ssh kevin@deltaur:/var/tmp/ fyf/
B.
rsync -a -u kevin -e ssh fyf/ deltaur:/var/tmp/
C.
rsync -a -u kevin -e ssh deltaur:/var/tmp/ fyf/
D.
rsync -a -e ssh fyf/ kevin@deltaur:/var/tmp/
题解
「rsync」是一个快速、多样化且支持远程操作的文件拷贝工具和指令,可以用来备份与还原文件。「-a」参数为封存(archive)模式,等同于「-rlptgoD」,可以递归拷贝目录,并保留符号链接、权限、时间、拥有者、群组和设备档等属性。「-e」参数可以设置要用来进入远程主机的 Shell 指令(通常会使用「ssh」)。「-u」(update)参数可以略过覆盖接收端上比备份还新的文件。而来源和目的的文件路径参数顺序是,来源在前,目的在后。如果路径要透过远程主机的 Shell 指令来访问,格式为「[用户名@]主机名称:路径」。
因此答案是选项「D」。
