sahib / rmlint

Extremely fast tool to remove duplicates and other lint from your filesystem
http://rmlint.rtfd.org
GNU General Public License v3.0
1.85k stars 128 forks source link

Feature: Ignore dup files with same relative path #645

Open nadapez opened 5 months ago

nadapez commented 5 months ago

While the primary purpose of rmlint is to identify duplicated files, I've realized its potential for detecting moved files between two mirrors. Synchronization tools like rsync lack an easy method to identify moved files efficiently, treating them as creations and deletions. This not only poses an efficiency issue but also makes it challenging to mirror file movements without using the --delete option in rsync. However, this option could unintentionally delete files in the target that don't exist in the source, which may not be the desired behavior. Rmlint could address this by introducing an option to ignore files with the same relative path. This could be implemented with a command like:

rmlint -km --ignore-same-path target \\ source

This command would detect only pairs of files with different relative paths, one in the source and one in the target. To complete the process, one would need to modify the removal command to move the target file to the corresponding path.