【发布时间】:2020-12-03 13:33:34
【问题描述】:
我有一个服务器位置(源),客户端整天经常提供大量文件。我的任务是将它们复制到另一个服务器位置(目标)并将这些复制的文件从源位置移动到源服务器中的另一个子目录。喜欢:
Before Copy:
Server A
/files
--- /done
--- File1.xml
--- File2.xml
--- File3.xml
Server B
/files
After Copy to Destination Server B and copied files moved to done folder of Source Server A:
Server B
/files
--- File1.xml
--- File2.xml
--- File3.xml
Server A
/files
--- File4.xml
--- /done
--- File1.xml
--- File2.xml
--- File3.xml
我想自动化这个过程,我已经查看了 windows robocopy 来实现这一点。但是,在复制文件时,每当客户端提供像 File4.xml 这样的新文件并且没有完全复制时,我都会遇到问题,复制它们也有风险。如上所述,如何正确复制和移动文件?两台服务器都在 Windows 上运行。
【问题讨论】:
-
你考虑过使用 scp 吗?
标签: java python bash rsync robocopy