'How can I mirror deleted duplicates from a source into a destination?

Here's the scenario: We have a computer running Windows 10 which has a directory that's backed up nightly. The backups are done with a batch file utilizing Robocopy and scheduled via Windows. The parameters are as such that the backup will always add any new files or existing file edits into the destination, but it will never delete files from the destination that have been deleted in the source. It essentially archives all files which are in the source directory at the end of each day.

Here's the tricky part. The source directory is very large, and occasionally someone finds a duplicate file (or several duplicates of a file) in it. When that happens, we need to delete all but one copy of the file, and then we need to access the backup directory manually, locate the file there, and do the same. This is tedious and time-consuming as it's not rare for someone to notice an entire subdirectory full of files that exist 5+ times each.

What we're looking for is a way to scan the source directory and all subdirectories inside for duplicate files and remove all but one copy of them, and then a way to reflect that into the destination. I've assumed that we will not be able to use Robocopy to reflect the changes in the destination due to the nature of the backup script it's running, but we do have the ability to run any third-party software on the destination directory as well, essentially running an action in both directories to clean each of them of duplicate files.

On that note, I'm not against using third-party tools to make this cleaner or more efficient, I'm just not aware of any.



Solution 1:[1]

There is one way to solve this problem I was also suffering from this problem. but I found that how to use "BATCH" file

There are mainly 2 command

X_COPY
ROBO_COPY

According to your need here, (1)x_copy will be helpfull

xcopywill backup your specific file or folder even if you changed some megabytes data, it will copy the new data and will not be replaced on previous data it will make new copy.

HOW TO DO

Open NotePad and type

xcopy "source file" "destination" /y/e/d/c/f/h/i/z/j

And then save your notepad as ".bat" file

for more requirement use below url

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/xcopy

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Arham Sanghvi