Mount With Some Directories Excluded

What is the problem you are having with rclone?

how can I mount a synced clone of the remote on my local storage while excluding some certain remote directories from the sync?

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

Sorry if this question is a bit general, I'm new to rclone so I've read the documentation and I know somehow that I probably have to use a combination of the "mount" and the "filter" commands. However, under neither of these topics in the documentation, I can find the link between the two, or some examples.

Also the documentation on filters is a bit hard to follow, for example, at one point it says: " A * matches anything but not a / ", and then in the examples below it, there's this example: *.jpg : matches "directory/file.jpg". Also filters seem to be very much related to excluding the "files" or at least it's not explicitly explained how one can exclude whole directories and their content. I only need to mount my whole Google Drive on a local point with some directories(which are heavy) being excluded.
I also couldn't do trial and error because I wasn't sure if these were the commands I needed to use at all... .

What is your rclone version (output from rclone version)

rclone v1.52.2

  • os/arch: linux/amd64
  • go version: go1.14.4

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

Ubuntu Focal Fossa 64bit

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

Google Drive

hello and welcome to the forum,

the docs can be confusing as there is no section dedicated to filtering directories, not files.
but this should work.

this is from the docs

dir/** - matches "dir/file.jpg"
       - matches "dir/dir1/dir2/file.jpg"
       - doesn't match "directory/file.jpg"
       - doesn't match "adir/file.jpg"

and

If you put any rules which end in / then it will only match directories.

1 Like

you can testing with using rclone list commands.
rclone lsd remote: --exclude=/dir/**

1 Like

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