Help understanding excludes

What is the problem you are having with rclone? Cannot wrap my head around how to exclude specific subdirectories

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

rclone v1.60.1-DEV

  • os/version: ubuntu 24.04 (64 bit)
  • os/kernel: 6.8.0-51-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.22.2
  • go/linking: dynamic
  • go/tags: none

Which cloud storage system are you using?

idrive

Issue:
I'd like to ideally keep the folder structure starting inside /home/user_name
There are subdirectories inside docker that I do not want or need backed up.

So far I've modified a script I found online and tried two things. First I've tried this to see if I could exclude everything except /documents, but the result was a backup the entirety of /user_name/

NOW=$(date  +"%Y-%m-%dT%H%M%S%z")
SOURCE=/home/user_name
DEST=idrive:user_name

rclone sync $SOURCE ${DEST} \
 --fast-list \
 --exclude="/downloads/**
 --exclude="/docker/**
 --progress -v \
 --backup-dir ${DEST}/backup/${NOW}

I then tried it using

rclone.sh
NOW=$(date  +"%Y-%m-%dT%H%M%S%z")
SOURCE=/home/user_name
DEST=idrive:user_name

rclone sync $SOURCE ${DEST} \
 --fast-list \
 --filter-from filter-list.txt
 --progress -v \
 --backup-dir ${DEST}/backup/${NOW}'
filter-list.txt
' + /documents/**
+ /docker/**
- /docker/dockge/emby/config/metadata
- /docker/dockge/emby/config/plugins
- /docker/dockge/emby/config/logs
- /docker/dockge/emby/config/cache
- /docker/dockge/emby/config/data
- /docker/dockge/crafty/docker/servers
- /docker/dockge/crafty/docker/logs
- /docker/dockge/crafty/docker/import
- *

And had the same result.
I am not married to this specific script but I'd like to be able to specify to backup /documents and /docker, while keeping their folder structure and in seperate folders so it looks exactly how they look inside /user_name/ and to add folders to exclude on the fly as I install new dockers as I want my entire docker folder to backup but there are subdirectories I don't need that take up significant backup storage

Thank you!

welcome to the forum,
that is a very old verion of rclone, can rclone selfupdate


not sure about the usage of --backup-dir.
in most cases, you want the dest and the backup dir to be seperate directories.

using something like this.

rclone sync $SOURCE ${DEST}/current --backup-dir ${DEST}/backup/${NOW}'

fwiw, filters work only on the source, easier and safer to test filters using
rclone ls $SOURCE --filter-from filter-list.txt

Thank you I was having trouble updating, this should help the function, I'm going to restructure my docker folder as well as I've just learnt the setup is a mess

yeah, rclone v1.60.1-DEV that is some third-party, custom compiled version of rclone from the OS package manager.
the only way to get offical lastest rclone is https://rclone.org/install/
after that, in the future, rclone selfupdate wil work as expected.

well, how did you install it?
and make sure to backup the rclone config file

https://askubuntu.com/questions/187888/what-is-the-correct-way-to-completely-remove-an-application

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