Getting bash: $: command not found

best way to test filters is with rclone ls.
that way you can see the list of source files that rclone will use for other commands such as rclone sync

Include/Excludes are relative from your path as well.

What are you trying to exclude?

So if you have a path, you have to make it relative:

felix@gemini:~$ rclone ls /home/felix/test
        0 one
        0 two
felix@gemini:~$ rclone ls /home/felix/test  --exclude /home/felix/test/one
        0 one
        0 two
felix@gemini:~$ rclone ls /home/felix/test  --exclude one
        0 two

i think you need to add a trailing slash for directories
/home/xxxxx/Games/

user01@wsl01:~/test$ tree
.
├── 02
│   └── file.02
└── Games
    └── file.01

user01@wsl01:~/test$ rclone ls . --exclude=Games
        0 Games/file.01
        0 02/file.02

user01@wsl01:~/test$ rclone ls . --exclude=Games/
        0 02/file.02

user01@wsl01:~/test$ rclone ls . --exclude=/Games/
        0 02/file.02

I am not sure how to use rcone ls for testing. Can you give example?

I am trying to exclude the directories in exclude-mega1crypt.txt file.

One post above you, I shared an example.

They are relative from your path so change it up and test with rclone ls.

Games/**
.Genymobile/**
.steam/**
.wine/**
.PlayOnLinux/**
Logs/**
.var/app/org.libretro.RetroArch/config/retroarch/cores/**
.local/share/lutris/**
Downloads/**
Thumbnails/**
Cache/**
cache/**
Thrash/**
temp/**

And try:

rclone ls /home/xxxxx/ mega1crypt: --exclude-from=/home/xxxxx/Scripts/Rclone/filters/exclude-mega1crypt.txt

Adding trailing slash didn't help. And i am trying to use --exclude-from, not --exclude.

  • for output on command line
    rclone ls /home/user --exclude-from=/home/xxxxx/Scripts/Rclone/filters/exclude-mega1crypt.txt

  • for output saved to a file
    rclone ls /home/user --exclude-from=/home/xxxxx/Scripts/Rclone/filters/exclude-mega1crypt.txt > output.txt

What if i have two directories named Games on different location in my home directory, and i want to exclude only one of them. If i use relative path will this not exclude both of them?

Can you share an example of what you mean specifically?

It's all based on the command you are running and you shared:

That command. Is that not the command you are running?

Yes, this is the command. But i am not sure what do you mean by relative paths. Do you mean i have to omit only this part of the paths in exclude-mega1crypt.txt file: /home/xxxxx/?

If you scroll up, I gave you the exact information and pasted it into my post:

Ok, got it.
And what about if i want to exclude all directories with specific name no matter their location? For example, if i want to exclude all directories with the name cache.

Can you share a specific example from your output?

My question is what to put in my exclude-mega1crypt.txt file if i want to exclude all directories with the name cache, and some other directories. Currently, this is what i have in the file:

Games/**
.Genymobile/**
.steam/**
.wine/**
.PlayOnLinux/**
Logs/**
.var/app/org.libretro.RetroArch/config/retroarch/cores/**
.local/share/lutris/**
Downloads/**
Thumbnails
Cache
cache
Thrash
temp

I want to exclude all directories with these names:

Thumbnails
Cache
cache
Thrash
temp

Can you share the example from your output of your directory structure?

felix@gemini:~/test$ rclone lsd /home/felix/test
          -1 2021-12-07 07:53:56        -1 blahcache
          -1 2021-12-07 07:53:46        -1 cache
          -1 2021-12-07 07:53:59        -1 cacheblah
          -1 2021-12-07 07:53:51        -1 startcacheend

So on your system run something similar and show the output and what you want to do so we have an example.

I have many apps that have directory named cache in their data location. And i want to exclude only the directories that have the exact name cache, not these that contain the word cache in their name, like blahcache, or cacheblah, or startcacheend.

Good luck as I've asked the same question a few times now and you won't share any examples/output like I've asked.

rclone tree /home/user01/test
/
├── 01
│   ├── blahcache
│   │   └── blahcache.01.txt
│   ├── cache
│   │   └── cache.01.txt
│   └── file.01.txt
└── 02
    ├── cache
    │   └── cache.02.txt
    ├── cacheblah
    │   └── cacheblah.02.txt
    └── file.02.txt

6 directories, 6 files

rclone tree /home/user01/test --exclude=cache/
/
├── 01
│   ├── blahcache
│   │   └── blahcache.01.txt
│   └── file.01.txt
└── 02
    ├── cacheblah
    │   └── cacheblah.02.txt
    └── file.02.txt

4 directories, 4 files
rclone ls /home/user01/test --exclude=cache/
        0 01/file.01.txt
        0 01/blahcache/blahcache.01.txt
        0 02/file.02.txt
        0 02/cacheblah/cacheblah.02.txt

I didn't put directory output because i don't get how this is important. I want to exclude directories by name, not by location. But if you insist here is few cache directories:

/home/user/.config/Mailspring/Cache
/home/user/.config/Portmaster/Cache
/home/user/.config/joplin-desktop/cache
/home/user/.config/tutanota-desktop/Cache