Filter "+ subdirectory"


I am trying to copy a subdirectory "dir2" to an azure blog container while retaining the directory structure. As such I need to specify:

rclone copy dir1 destination:container --filter "+ dir1/dir2/**"

When I test this with lsl, the files listed are not restricted to my dir1/dir2/ subdirectory

rclone lsl  . --filter "+ dir1/dir2/**" 

What am I doing wrong?

$ rclone version
rclone v1.47.0

  • os/arch: linux/amd64
  • go version: go1.12.4


You need a --filter "- *" to exclude everything else.

--include adds one of these for you automatically, so you could use that instead of --filter

1 Like

Thanks, I can now get it to work with either --filter and --include. Great tool!

I am really impressed with how I can copy directory structures onto a flat file system in azure blobs. Is this translation being done by rclone or on the server side?


Thanks :blush:

It is done by the rclone azureblob backend. There is only one point of contention - rclone won't let you have an empty directory. Some tools create 0 length blobs named "directory/" but rclone doesn't to save you transactions.