Specifying excluding file as Environment variable

What is the problem you are having with rclone?

I have a elude.txt file, that when I run rclone sync src dst --exclude-from exclude.txt works correctly, but I can't get this to work as an environment variable, such that I can run rclone sync src dst and still ignore those in elude.txt

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

rclone v1.66.0

  • os/version: darwin 12.7.4 (64 bit)
  • os/kernel: 21.6.0 (x86_64)
  • os/type: darwin
  • os/arch: amd64
  • go/version: go1.22.1
  • go/linking: dynamic
  • go/tags: none

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

Irrelevant as this is all local, though I would assume it's the same in Google Drive, and all others.

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

rclone sync src dst --exclude-from exclude.txt

and replace with

rclone sync src dst

The rclone config contents with secrets removed.

    "DEFAULT": {
        "RCLONE_EXCLUDE": "'.DS_Store'",
        "RCLONE_EXCLUDE_FROM": "/Users/name/rclone/exclude.txt",
        "RCLONE_FILTER_FROM": "/Users/name/rclone/exclude.txt"

As you can see, I have three attempts at trying to exclude, but no work, the exclude file is just .DS_Store

A log from the command with the -vv flag

Not sure what to put here, but on running the command with no explicit call of --exlude-from, the first output is

2024/04/17 15:45:07 DEBUG : .DS_Store: Need to transfer - File not found at Destination
Transferred:   	          0 B / 0 B, -, 0 B/s, ETA -
Elapsed time:         0.0s

so it is clearly not seeing any of these attempts at excluding the file. The rest is some couple hundred lines that I don't think are relevant

welcome to the forum,

export RCLONE_EXCLUDE_FROM=exclude.txt
rclone ls src
  • rclone does not support DEFAULT section.
  • cannot put global flags into config file.

Okay well now I am very confused, I did initially run this export command and it didn't work, but now running it does, suggesting that I made either a typo or something else. That is strange I can't add this to the config file, but okay I guess.

To get this working as I wanted, I then added

export RCLONE_EXCLUIIDE_FROM=exclude.txt

replacing that file with the relevant path to file, in my .zshrc file.

Thank you for your help, sorry for my error.


check this github issue from 2018
Storing defaults for global flags in the config file

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