I have a VM running XP on which files get uploaded at random moments. I need a script or utility fit for the command line, that would run every X minutes (for instance) and MOVE all uploaded files to a shared dir on a Win7 box.
Now, the command-line
move command doesn't run across drives, even less so across shares.
(And it gives the super helpful message
I could do a
copy src desr_share rm src
...but here's the tricky part:
When the copy command runs, it may happen that a file is uploaded at the same time. The
copy may upload just a chunk of the file, or skip it completely and move on, but later, when the
rm kicks in, the file may be completely uploaded, and the
rm will erase it, without it having been properly copied to the destination.
So I need something that has the
move semantics (copy a file and delete it only if successful), but that would work across machines.
PS. I don't mind if a file gets only partially moved, as long as it's not then deleted. I will force overwriting any destination files, and on the next run, the file will be uploaded again, completely.