Can I sync a top level directory tree and remove anything missing in the source?

STOP and READ USE THIS TEMPLATE NO EXCEPTIONS - By not using this, you waste your time, our time and really hate puppies. Please remove these two lines and that will confirm you have read them.

What is the problem you are having with rclone?

I have an old copy of a cloud folder on my NAS that I would like to clean up but not fully sync. I would like to sync the cloud folder to my NAS folder but only remove the folders/files that are missing from the cloud folder. I do not want to sync all the files from the cloud to my NAS as I do not have the bandwidth to do that.

So for example, on my NAS I have...

Folder A with 100 files
Folder B with 10 files
Folder C with 100 files
Folder D with 1000 files

On my cloud drive I have

Folder A with 1000 files
Folder C with 1000 files

In this case I would just like to remove Folder B and Folder D but not add the 900 files added to Folder A and C

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

rclone v1.66.0

  • os/version: unknown
  • os/kernel: 4.4.302+ (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.22.1
  • go/linking: static
  • go/tags: none

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

Box

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

Paste command here

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

Paste config here

A log from the command that you were trying to run with the -vv flag

Paste  log here

can use filters to include just the folders you want to sync
rclone sync remote: /path/to/local --include="Folder A"

Thanks. That is the issue though, how can I specify the filter? There are hundreds of folders so I cant do it manually.

well, you only posted about four folders, A,B,C,D

by default, if you sync a folder, all subfolders are also synced.

Sorry if I was too vague, if it was only 4 folders I would do it manually. I figured out a work around by mounting both source and destination and doing a diff on the two and then piping that in to awk/xargs

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