Exclude a directory and all subdirectories

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 am syncing a large directory and whish to exclude the thunderbird directory and all subdirectories with this command --exclude=/media/PGP/PGP/mail/**
( /usr/bin/rclone sync /media/PGP/ pgp:pgp/ --skip-links --backup-dir pgp:Ver/VersionsPgp/date -I --transfers=20 --drive-chunk-size 512M --max-backlog 999999 --fast-list --log-level INFO --log-file=/home/ard/Desktop/pgp.txt --exclude=/media/PGP/PGP/mail/** )
But it still copies this directory, I have seen other posts on this subject some include quotes around the path but this does not make a difference

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

rclone v1.66.0-beta.7604.1045f5412

  • os/version: debian bookworm/sid (64 bit)
  • os/kernel: 6.5.0-14-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.21.5
  • go/linking: static
  • go/tags: none

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

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
/usr/bin/rclone sync /media/PGP/ pgp:pgp/ ...  --exclude=/media/PGP/PGP/mail/**

your source root directory is /media/PGP/ and exclude does not see anything beyond so it should be:


You need quotes when you have spaces in names etc. You can also use them always if you wish.

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