我想从远程机器下载大量数据。
我希望每次文件下载完成时都会删除远程计算机上的数据。
我怎么做? rsync 是否有一个标志来执行此操作?
您需要通过--remove-source-files
的选项rsync
命令。它说rsync
从发送端删除属于传输一部分且已在接收端成功复制的文件(即非目录)。请勿通过--delete
选项rsync
命令,因为它从目标目录中删除无关文件。
成功传输后删除源rsync
.
语法是:
rsync --remove-source-files -options /path/to/src/ /path/to/dest
rsync --remove-source-files -options /path/to/src/ computerB:/path/to/dest
rsync --remove-source-files -av /path/to/src/*.avi computerB:/path/to/dest
参考 :http://www.cyberciti.biz/faq/linux-unix-bsd-appleosx-rsync-delete-file-after-transfer/ http://www.cyberciti.biz/faq/linux-unix-bsd-appleosx-rsync-delete-file-after-transfer/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)