-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFE: tell fdupes to always prefer a certain directory #132
Comments
I'd like to see this feature too! |
very needed feature to automatically delete all the doubles of pictures imported and imported again from and to different devices |
Can PR #144 be reviewed and merged? This is a very needed feature for situations where directory A has some of the same files as B, but not in the same structure. Happened to me when trying to merge a relative's photo library with mine. They had a lot of my pics but had rearranged them. I want to run |
jdupes, a fdupes fork, is doing that with "-O" |
I'm the author of jdupes. No, it does not. That's the parameter order priority flag and only controls sorting. |
the order priority_flag is controlling the sorting, meaning you can say that duplicates should rather be deleted in dir2 then in dir1 for example. ok, so far so good. the question of the topic was: "tell fdupes to always prefer a certain directory" The ability to set priorities is exactly doing that "prefer a directory" My answer was correct in every way. |
No, it's not. Your ego is not in question here; your correctness is. The parameter order controls the sorting, not the "preserve priority." Deletions will gladly nuke items in the first directory specified. It'll delete files in I will not entertain further discussion on this. You can't tell me I don't know how the program I wrote works. |
No, sorry you are not right andthis is not about my ego, its about your ego sadly, i just wanted to help and you aredoing exactly the opposite to proof i-dont-know-what. The initial poster was searching for a solution to prefer one driectory over another, which means "if possible delete from directory x and not from y, if its not possible do what you have to do" and for @bjhartin
i hope that helped. |
@Friday13th87 You're being really unhelpful. The fellow said he's the author of jdupes; shut it down. Whether you think you're right no longer matters. You're giving advice you claim as authoritative when the author of the program refuted you. To anyone visiting this thread (and likely any others with this Friday person): caveat emptor. I came looking for a way to do this thing, too, incidentally. I'd love a way to I suppose it's back to setting the "master" as read-only and running fdupes to see if it blows up. |
To be fair: I didn't write every piece of code in jdupes and it's entirely possible to trip over my own human errors. The code behind |
@JohnCrafton you might find the example scripts in the jdupes code base to be useful. I recognized that many people want to perform custom actions that the core program doesn't handle, so I wrote some template/example shell scripts that can be modified to suit your needs. They should also be able to use |
If you don't need it to run unsupervised (via -N) then you can use the new fdupes interactive mode to do this: selb /some/arbitrary/master/path The first command will select every file in your "master" path, the second will deselect those and instead select their duplicates, the third will mark the now selected ones for deletion, and the last one will delete them. |
Been awhile. Somewhere I saw this recommended for choosing which to delete:
I can't get that to work on macOS, and I am sure someone here can suggest why. This is an alternative method of getting what you want. |
@101Dude you should not use rm with xargs, it will do the wrong thing with spaces or files that need quoting. |
@macau23 xargs runs into issues when path names have special characters. The following command results in an error because of a single quote in a filename:
The UNIX way around this is to add another command between the grep and xarg commands:
This addition comes from an excellent explanation at Make xargs execute the command once for each line of input The full command would then be:
Check this command first using echo or another non-destructive command before using rm. An example of a non-destructive option is to use the
|
Any solution? |
Here's how you can delete duplicates without removing files from a specific directory. You'll use the
This command will delete duplicates found in the If you have three or more directories, add slashes in the order of priority. For instance, with four directories:
This setup ensures that any duplicates found in I hope this helps. |
Clever! |
I'd like to be able to tell fdupes to always prefer to preserve files within a given directory if duplicates are found.. At the moment the order of presented duplicates is not deterministic and it means that deleting duplicate files takes a lot longer:
After the suggestion:
This enables me to use --noprompt without losing files from the wrong directory.
The text was updated successfully, but these errors were encountered: