I was following up on @MilesAhead's
comment which had caught my interest as I had not previously tried out RichCopy
I would take a look at RichCopyRichCopy
It was written by a Microsoft Employee so it likely has rules or filters xcopy and robocopy do not.
looked to have some uniquely useful functionality, so I have downloaded and installed it - thanks for the tip!
Now I might be missing something here, so I apologise in advance if I have it wrong, but since I had only skimmed over the OP and had not actually read it fully, I thought I should at least try and understand it, so I read about the requirement for the two Filters
- Filter #1: If the file being moved has the same name, extension and size as a file already existing in the target folder, then overwrite the existing file.
- Filter #2: If the file being moved has the same name and extension as a file already existing in the target folder, but the two files are different in size, then move the file, but keep both files.
On reading the OP, it occurred to me that the requirement in Filter #1
would seem to be redundant
, since, if
a file about to be moved had the same name, extension and size as a file already existing in the target folder, then there would be no need to move it and overwrite the existing file in the target
, and thus you would leave it as-is.
"Size" could be a potentially unreliable comparison, so I would recommend using "Content" instead.
What could be useful, therefore, would be to verify whether files in the source directory with identical name/extension
to files in the target directory were actually identical in content (~size)
, and only overwrite/copy (one way or the other) if the content were different
and perhaps depending on the date. I would use a file checksum
comparison between the two.
Normally this would seem to be a kinda paranoid check, but I actually do it when verifying my archived (backup) files, and it's a piece of cake to do it using xplorer²
. In the example below, I've just used two panes showing views of two folders - Source and Target - but xplorer² could enable the user to run this verification whilst syncing nested Source directories (plural) and the corresponding nested Target directories, in the LHS and RHS panes, respectively. This would only apply where the directory trees were identical. You could also use flat files to get a view of the scale of the overall problem.
The above also gives you the files for Filter #2
, so that you can then copy/move all those (already auto-selected) in the Source folder into the Target folder, keeping the names in the Target, but automatically incrementing by +1 for the newly-copied/moved files, so nothing in the Target folder will have been overwritten/destroyed. However, it would probably be preferable to use a backup tool (e.g. something with versioning, like FreeFileSync) for this, so that the Target file name remained unchanged, and the older version was moved to a version folder.