How to exclude multiple folders while doing 'rclone copy'?

What is the problem you are having with rclone?

I'm trying to do 'rclone copy' and prevent copying some of the folders inside of the copy source. The direct usage of '--exclude' option seems to be totally ignored by my rclone instance, and I don't know what to do else.

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

rclone v1.68.2

  • os/version: Microsoft Windows 10 Pro 22H2 (64 bit)
  • os/kernel: 10.0.19045.4529 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.23.3
  • go/linking: static
  • go/tags: cmount

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

Amazon Deep Archive

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

rclone copy C:/Users/sengl/Documents AMAZON-DEEP-ARCHIVE:clevo/Documents  --exclude="C:/Users/sengl/Documents/Healtcare/**" --exclude="C:/Users/sengl/Documents/Telegram/**"  --checksum --s3-storage-class DEEP_ARCHIVE --no-update-modtime --s3-no-check-bucket -vv --log-file=c:\tmp\rclone-to-aws-Documents.log

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

[AMAZON-DEEP-ARCHIVE]
type = s3
provider = AWS
access_key_id = XXX
secret_access_key = XXX
region = us-west-2
location_constraint = us-west-2
storage_class = DEEP_ARCHIVE

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

2025/01/12 01:33:48 DEBUG : Healtcare/tdata/working: Need to transfer - File not found at Destination
2025/01/12 01:33:48 ERROR : Healtcare/tdata/working: Failed to copy: failed to open source object: The process cannot access the file because it is being used by another process.

hi,

given that filters work only on the source, the best/safest way to test is rclone ls
and no need to list files in deep archive, which can get expensive.

filters are relative to the root of the source, not to the root of the c: drive.

so test something like
rclone ls C:/Users/sengl/Documents --exclude="/Healtcare/" -vv

1 Like

I don't quite understand what part of my command tries to list deep archive files aside from '--checksum' option. Did you mean exactly this attempt to avoid copying files with the same MD5?

well, each time you run rclone copy, rclone has to list+compare the files in both source and dest.
aws charges per api call to list files in deep archive.

but using rclone ls, will only list the local files.

1 Like

instead of using multiple --exclude on the command line
check out --exclude-from

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