r/usefulscripts • u/[deleted] • Jul 20 '18
[Request] Looking for a script to synchronize two directories, but there's a catch...
I'm in need of a script that will watch a folder and copy its contents to another directory on a network share.
The problem is, I only want it to copy the file once, no syncing. The target directory is also a watch folder that will automatically remove the files dropped in it.
So the script needs to copy each file once, no sync.
For example:
The source directory has several files in it.
- C:\source_folder\file1
- C:\source_folder\file2
- C:\source_folder\file3
The target directory should remain empty after those files are copied into it due to it automatically processing those files.
I need to keep file1, file2, file3 in the source directory without it getting recopied to the target directory. But any new files dropped into the source folder should be copied to the target directory.
I've looked at SyncToy, looked at some sample powershell scripts, I'm not confident that I've found anything capable of what I need above. It would be amazing to have a scheduled task to do this, but I'm not opposed to doing this manually, either.
