Any way to `dedupe` in skip mode, but force delete from one folder only?

Say I have 2 folders, where folder1 contains duplicates of items in folder2.

Is there any way to find the dupes and delete them but ONLY from folder1? I.e., don’t touch anything in folder2.

At the end, folder2 should be unchanged, and folder1 should no longer contain any items that are in folder2.

Hmm, you could merge the two folders like this (untested)

rclone move --ignore-existing remote:folder1 remote:folder2

which should put unique stuff from folder1 into folder2 and the duplicates will remain in folder1.

(If you want to try that, try with -vv --dry-run first!)

Alternatively you could do something like this

rclone lsf --files-only -R remote:folder1 | sort > folder1-list
rclone lsf --files-only -R remote:folder2 | sort > folder2-list

sort folder1-list folder2-list | uniq -d > duplicate-list

You’ll then have a list of duplicate files in duplicate-list

Remove them from folder1 like this

rclone delete --dry-run --files-from duplicate-list remote:folder1
1 Like