Delete missing files/folders on destination when compared to source

What is the problem you are having with rclone?

I have files in Dropbox (source) & Google Drive (destination) and I want all files & folders to be deleted on destination if they do not exist on source. The command I tried doesn't work and I'm not sure what's the most efficient way to get this done.

Run the command 'rclone version' and share the full output of the command.

rclone v1.52.2
os/arch: linux/amd64
go version: go1.14.4

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

Dropbox
Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone delete dropbox:/folder happitimes:folder —missing-on-src

start with updating your rclone version. rclone v1.52.2 is many years old.

Then you can try something like this:

rclone lsf -R --files-only source: > source-listing
rclone lsf -R --files-only dest: > dest-listing
comm -13 source-listing dest-listing > files-to-delete
rclone delete --files-from files-to-delete --dry-run dest:

In similar way you can deal with directories.

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