Skip to content

Conversation

@ttyusupov
Copy link

@ttyusupov ttyusupov commented Nov 12, 2023

I've added --match-relative-path support for my own needs and seems there is an existing feature request for that: #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
Copy link
Contributor

cebtenzzre commented Nov 12, 2023

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
Copy link
Author

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.

@JVAQUEROM
Copy link

Was this finally added? I am interested in this feature. However, I have the last version and cannot see it implemented.

Regards!

@vassilit vassilit force-pushed the match-relative-path branch from 3680f57 to 73bc74b Compare January 7, 2026 09:28
g_assert(node_a);
g_assert(node_b);

diff = g_ascii_strcasecmp(node_a->basename, node_b->basename);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that we use g_ascii_strcasecmp in rm_file_basenames_cmp but I think that its behaviour should be documented in the manpage as it has non-obvious consequences with today's UTF-8 filesystems (it is case-sensitive for non-ASCII characters) and with many other encodings it can create false-matches.

@vassilit
Copy link
Collaborator

vassilit commented Jan 7, 2026

We should update the manpage and create tests for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is it possible to find duplicates inside the same folder (sharing the pathname)

4 participants