I have a server location (source) where client provides number of files frequently all day long. My task is to copy them into another server location (destination) and move those copied files from source location to another sub directory in the source server. Like:
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
I want to automate this process and I have looked through the windows robocopy to achieve this. But while copying the files I faced a problem whenever client provides a new file like File4.xml and isn't fully copied, it have a risk to copy them too. How can properly copy and moves the file as explained above? Both servers are running on windows.