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

Added --match-relative-path option and support #640

Open ttyusupov opened 7 months ago

ttyusupov commented 7 months ago

I've added --match-relative-path support for my own needs and seems there is an existing feature request for that: https://github.com/sahib/rmlint/issues/550.

In my case it was useful to only keep files that have been changed in different backup snapshots and keep files which have different relative paths (and different content than file with the same relative path in original copy) although the same content as some file in original copy.

cebtenzzre commented 7 months ago

How are you making these backups? Typically this is something that is done with rsync (which can copy only files that have changed relative to a previous backup with --compare-dest) or with lightweight snapshots (e.g. btrfs snapshots are free because of reflinks and deleting files does not usually reduce disk usage). Making a full copy of an entire hierarchy only to delete most of it seems inefficient.

ttyusupov commented 7 months ago

These were old backups on external drive made by TimeMachine which I needed to save somewhere else. Due to some reasons some files in snapshots were copies with exactly the same content rather than hardlinks.

Another potential scenario is when you already have a full copy on external drive but then realize you only want to keep old versions of changed files because you have a new backup on another drive.