Need help with excluding folders by name

I am using rclone on windows and i setup configuration file for mega.nz. I tested the setup and the syncing is working fine. But i am having problems excluding folders from the syncing. I want to exclude all folders with the name cache. I created a file exclude.txt and in the file i inserted this "/cache/**". Then i appended this parameter --exclude-from exclude.txt to my command but the folders with the name cache are not excluded.

A leading / means only at the root. You probably want cache/** if you want directories named cache anywhere in the file system.

try this, without the leading slash.

"cache/**"

Thanks. This worked cache/**. But this didn't worked "cache/**".

Another question: can i exclude only the content of the folders, but to keep the folders?

if you are using exclude-from, then you do not need the quotes.

Hmm...

If you do something like cache/?** that might work

if you want to mirror the directory structure from local to remote, there are a few ways to do that.

  1. create a batch file with this
rclone lsf C:\data\test --dirs-only -R > thedirs.txt
for /f %%u in (thedirs.txt) do rclone mkdir mega01:/test/%%u
  1. use rclone mount and xcopy

rclone mount mega01: x:
xcopy C:\data\test x:\test\ /t /e

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