How to remove duplicate files and preserve folders?

What is the problem you are having with rclone?

I have many folders that have a duplicate filename in the same location. When I try to delete them, it delete the contents of the folder!

How can I only delete the file? Can I search for these duplicate files and remove them, leaving the folders and their contents in place?

They look like this:

rclone lsf "api_crypt:Kids_TV/Little Princess"
Little Princess Series 3/
Little Princess Series 3

My delete command was: rclone delete "api_crypt:Kids_TV/Little Princess/Little Princess Series 3" but these erased the contents of the folder!

I ended up filtering by excluding a dozen different filetypes. Is it possible to filter to include files with no extensions?

What is your rclone version (output from rclone version)

rclone v1.53.0

  • os/arch: darwin/amd64
  • go version: go1.15

Which OS you are using and how many bits (eg Windows 7, 64 bit)


Which cloud storage system are you using? (eg Google Drive)

Google Drive

For dealing with duplicates, you should check out rclone dedupe and use that instead.

They are not actually duplicates, they just have the same name. When I run dedupe, it does not identify them as duplicates.

I have cleaned them up manually using deletefile.

Is it not possible to filter for names without an extension?

That is a corner case which we don't deal with very well!

rclone dedupe should really detect this and do something, but it doesn't at the moment.

You can include everything with extensions --include "." which will exclude everything without extensions. Test first with -i flag.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.