Getting bash: $: command not found

What is the problem you are having with rclone?

I get bash: $: command not found when i execute my rclone command.

What is your rclone version (output from rclone version)

rclone v1.57.0
  • os/version: debian 10.11 (64 bit)
  • os/kernel: 4.19.0-18-amd64 (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.17.2
  • go/linking: static
  • go/tags: none

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

mega.nz

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

rclone sync /home/user/ mega1crypt:

The rclone config contents with secrets removed.

[mega1crypt]
type = crypt
remote = mega1:backup
filename_encryption = standard
directory_name_encryption = true
password = xxxxxxxxxxx

A log from the command with the -vv flag

I don't have a log, because the command do not provide any logs. 

hi,

  • if rclone cannot run on your system, then how did you get the output of rclone version???

  • how are you running rclone, on command line, via script or what?

  • let's see where/if rclone is installed on your system
    what is the bash output of which rclone?

user01@wsl01:~$ which rclone
/usr/bin/rclone

================

  • that output looks a little strange as no exectuable is listed.
    for example,
user01@wsl01:~$ donothing
donothing: command not found

I tried the command again and this time it worked, i don't know why it din't worked before.
But i have another problem. I am trying to use the --exclude-from option, but it doesn't seem to work, because if i use --dry-run with, and without, the --exclude-from option it uploads the same size of data. This is the command:

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

And this is the content of exclude-mega1crypt.txt file:

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

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.