Sync, need to copy only certain subfolders

@thestigma, help me out. i got a time crunch.
i need to download an entire bucket to my local server.
for that bucket i want to download only subfolders named zip but keep the directory structure.
i tried a few different ways but not working.

%root%\rclone.exe sync wasabiwest01:en07 C:\tempmove\ --include=zip/** %logfile% --dry-run

and output is
2019/10/30 12:54:46 DEBUG : en07.kdbx: Excluded
2019/10/30 12:54:46 DEBUG : en07.keepass: Excluded
2019/10/30 12:54:46 DEBUG : en07.rclone: Excluded
2019/10/30 12:54:46 DEBUG : en07.userprofile: Excluded

so what do i need to have for the include flag?

thanks much,
your loyal monkeyman

I recently picked up some new understanding of this, so I think I can help...
PS: for your reference, this is not regex, but BLOB (from Linux, used in grep)
They are subtly different, so don't go look at regex guides, look at BLOB guides, or else you will spend a lot of time confused like I was :stuck_out_tongue:

So I think what you need to match a fodler named zip is:
--include /zip/ (exact match
or
--include /*zip*/ (partial match).

so expand on that, this would be "any files inside a folder called "zip"
--include /zip/*

And this would be "any files AND subfolders inside a folder named "zip"
--include /zip/**

So the last one should be what you specify you need.
Please do a quick test with that...
rclone ls /location --include /zip/** --max-depth 3
(the last parameter is how far down in the structure to recurse, limit this to avoid unnecessary spam in output)

I did a quick test
rclone ls F: --include /*TEST*/** --max-depth 3

and this lists all files and files in subfodlers inside of the top folder "TESTFILES" on F:

So assuming I understood your request correctly, this looks right to me (but please verify on your own).

i tried
%root%\rclone.exe ls wasabiwest01:en07 --include /zip/** %logfile% --dry-run --log-level=DEBUG
and
my previous
%root%\rclone.exe ls wasabiwest01:en07 --include /zip/** %logfile% --dry-run --log-level=DEBUG

and each time the only ouput i get is:
2019/10/30 13:14:48 DEBUG : en07.calibre: Excluded
2019/10/30 13:14:48 DEBUG : en07.data: Excluded
2019/10/30 13:14:48 DEBUG : en07.firefox: Excluded
2019/10/30 13:14:48 DEBUG : en07.kdbx: Excluded
2019/10/30 13:14:48 DEBUG : en07.keepass: Excluded

also this is not working
%root%\rclone.exe ls wasabiwest01:en07 --include /zip/ %logfile% --dry-run --log-level=DEBUG

No, you shouldn't try to match folders on their own. that's not really possible. That was a partial example for illustration. You always need to specify what inside the fodlers you are trying to match for (even if it is "everything", defined by ** )

I am not sure how your folder structure looks so it's a little hard to see what's wrong.
the "zip" folder is next to these files you listed? it should be hitting that with /zip/**
Try /*zip*/** maybe to include any folders that have zip somewhere in the name (partial match).

all of these give the same output
%root%\rclone.exe ls wasabiwest01:en07 --include /zip/ %logfile% --dry-run --log-level=DEBUG
%root%\rclone.exe ls wasabiwest01:en07 --include /zip/ %logfile% --dry-run --log-level=DEBUG
%root%\rclone.exe ls wasabiwest01:en07 --include /zip/* %logfile% --dry-run --log-level=DEBUG
%root%\rclone.exe ls wasabiwest01:en07 --include /zip/** %logfile% --dry-run --log-level=DEBUG

what is the full path to one of these folders you are trying to match for?

damn it, this forum is mangling my commands, there has to be a way for the forum not to convert and pervert posts!
and the path is as per the command
wasabiwest01:en07

Use the "preformatted text" option in the editing box to avoid forum formatting problems, Good for code.

%root%\rclone.exe ls  wasabiwest01:en07 --include /zip/  %logfile% --dry-run --log-level=DEBUG
%root%\rclone.exe ls  wasabiwest01:en07 --include /*zip*/ %logfile% --dry-run --log-level=DEBUG
%root%\rclone.exe ls  wasabiwest01:en07 --include /zip/* %logfile% --dry-run --log-level=DEBUG
%root%\rclone.exe ls  wasabiwest01:en07 --include /zip/** %logfile% --dry-run --log-level=DEBUG

ok, I got that - but to see why the last one fails I think I need to see the full path to one of the folders you are trying to match for :slight_smile:

zip
for the bucket, there are a bunch of subfolders named zip.
i want to download just those subfolders and all folders and files underneath it.

image

image

BTW, is this on a windows or bash terminal?
Because on Linux there is a risk that some GLOB commands can be interpreted as REGEX.
TO avoid mistakes of that nature, put quotes around it. It may be that simple.

--include "/*zip*/**"

%root%\rclone.exe ls  wasabiwest01:en07 --include="/zip/"  		%logfile% --dry-run --log-level=DEBUG
%root%\rclone.exe ls  wasabiwest01:en07 --include="/*zip*/" 	%logfile% --dry-run --log-level=DEBUG
%root%\rclone.exe ls  wasabiwest01:en07 --include "/zip/*" 		%logfile% --dry-run --log-level=DEBUG
%root%\rclone.exe ls  wasabiwest01:en07 --include "/zip/**" 	%logfile% --dry-run --log-level=DEBUG
%root%\rclone.exe ls  wasabiwest01:en07 --include "/*zip*/**" 	%logfile% --dry-run --log-level=DEBUG

2019/10/30 13:36:00 DEBUG : rclone: Version "v1.49.3" starting with parameters ["c:\data\rclone\scripts\rclone.exe" "ls" "wasabiwest01:en07" "--include=/zip/" "--log-level=DEBUG" "--log-file=c:\data\rclone\scripts\rr\other\mount\logfile.txt" "--dry-run" "--log-level=DEBUG"]
2019/10/30 13:36:00 DEBUG : Using RCLONE_CONFIG_PASS password.
2019/10/30 13:36:00 DEBUG : Using config file from "c:\data\rclone\scripts\rclone.conf"
2019/10/30 13:36:01 DEBUG : andotp: Excluded
2019/10/30 13:36:01 DEBUG : en07.calibre: Excluded
2019/10/30 13:36:01 DEBUG : en07.data: Excluded
2019/10/30 13:36:01 DEBUG : en07.firefox: Excluded
2019/10/30 13:36:01 DEBUG : en07.kdbx: Excluded
2019/10/30 13:36:01 DEBUG : en07.keepass: Excluded
2019/10/30 13:36:01 DEBUG : en07.rclone: Excluded
2019/10/30 13:36:01 DEBUG : en07.userprofile: Excluded
2019/10/30 13:36:01 DEBUG : firefox: Excluded
2019/10/30 13:36:01 DEBUG : kdbx: Excluded
2019/10/30 13:36:01 DEBUG : keepass: Excluded
2019/10/30 13:36:01 DEBUG : one: Excluded
2019/10/30 13:36:01 DEBUG : rclone: Excluded
2019/10/30 13:36:01 DEBUG : 5 go routines active
2019/10/30 13:36:01 DEBUG : rclone: Version "v1.49.3" finishing with parameters ["c:\data\rclone\scripts\rclone.exe" "ls" "wasabiwest01:en07" "--include=/zip/" "--log-level=DEBUG" "--log-file=c:\data\rclone\scripts\rr\other\mount\logfile.txt" "--dry-run" "--log-level=DEBUG"]
2019/10/30 13:36:01 DEBUG : rclone: Version "v1.49.3" starting with parameters ["c:\data\rclone\scripts\rclone.exe" "ls" "wasabiwest01:en07" "--include=/zip/" "--log-level=DEBUG" "--log-file=c:\data\rclone\scripts\rr\other\mount\logfile.txt" "--dry-run" "--log-level=DEBUG"]
2019/10/30 13:36:01 DEBUG : Using RCLONE_CONFIG_PASS password.
2019/10/30 13:36:01 DEBUG : Using config file from "c:\data\rclone\scripts\rclone.conf"
2019/10/30 13:36:02 DEBUG : andotp: Excluded
2019/10/30 13:36:02 DEBUG : en07.calibre: Excluded
2019/10/30 13:36:02 DEBUG : en07.data: Excluded
2019/10/30 13:36:02 DEBUG : en07.firefox: Excluded
2019/10/30 13:36:02 DEBUG : en07.kdbx: Excluded
2019/10/30 13:36:02 DEBUG : en07.keepass: Excluded
2019/10/30 13:36:02 DEBUG : en07.rclone: Excluded
2019/10/30 13:36:02 DEBUG : en07.userprofile: Excluded
2019/10/30 13:36:02 DEBUG : firefox: Excluded
2019/10/30 13:36:02 DEBUG : kdbx: Excluded
2019/10/30 13:36:02 DEBUG : keepass: Excluded
2019/10/30 13:36:02 DEBUG : one: Excluded
2019/10/30 13:36:02 DEBUG : rclone: Excluded
2019/10/30 13:36:02 DEBUG : rclone: Version "v1.49.3" finishing with parameters ["c:\data\rclone\scripts\rclone.exe" "ls" "wasabiwest01:en07" "--include=/zip/" "--log-level=DEBUG" "--log-file=c:\data\rclone\scripts\rr\other\mount\logfile.txt" "--dry-run" "--log-level=DEBUG"]
2019/10/30 13:36:02 DEBUG : rclone: Version "v1.49.3" starting with parameters ["c:\data\rclone\scripts\rclone.exe" "ls" "wasabiwest01:en07" "--include" "/zip/" "--log-level=DEBUG" "--log-file=c:\data\rclone\scripts\rr\other\mount\logfile.txt" "--dry-run" "--log-level=DEBUG"]
2019/10/30 13:36:02 DEBUG : Using RCLONE_CONFIG_PASS password.
2019/10/30 13:36:02 DEBUG : Using config file from "c:\data\rclone\scripts\rclone.conf"
2019/10/30 13:36:02 DEBUG : andotp: Excluded
2019/10/30 13:36:02 DEBUG : en07.calibre: Excluded
2019/10/30 13:36:02 DEBUG : en07.data: Excluded
2019/10/30 13:36:02 DEBUG : en07.firefox: Excluded
2019/10/30 13:36:02 DEBUG : en07.kdbx: Excluded
2019/10/30 13:36:02 DEBUG : en07.keepass: Excluded
2019/10/30 13:36:02 DEBUG : en07.rclone: Excluded
2019/10/30 13:36:02 DEBUG : en07.userprofile: Excluded
2019/10/30 13:36:02 DEBUG : firefox: Excluded
2019/10/30 13:36:02 DEBUG : kdbx: Excluded
2019/10/30 13:36:02 DEBUG : keepass: Excluded
2019/10/30 13:36:02 DEBUG : one: Excluded
2019/10/30 13:36:02 DEBUG : rclone: Excluded
2019/10/30 13:36:02 DEBUG : -position-left-5C: Excluded
2019/10/30 13:36:02 DEBUG : 5 go routines active
2019/10/30 13:36:02 DEBUG : rclone: Version "v1.49.3" finishing with parameters ["c:\data\rclone\scripts\rclone.exe" "ls" "wasabiwest01:en07" "--include" "/zip/
" "--log-level=DEBUG" "--log-file=c:\data\rclone\scripts\rr\other\mount\logfile.txt" "--dry-run" "--log-level=DEBUG"]
2019/10/30 13:36:03 DEBUG : rclone: Version "v1.49.3" starting with parameters ["c:\data\rclone\scripts\rclone.exe" "ls" "wasabiwest01:en07" "--include" "/zip/" "--log-level=DEBUG" "--log-file=c:\data\rclone\scripts\rr\other\mount\logfile.txt" "--dry-run" "--log-level=DEBUG"]
2019/10/30 13:36:03 DEBUG : Using RCLONE_CONFIG_PASS password.
2019/10/30 13:36:03 DEBUG : Using config file from "c:\data\rclone\scripts\rclone.conf"
2019/10/30 13:36:03 DEBUG : andotp: Excluded
2019/10/30 13:36:03 DEBUG : en07.calibre: Excluded
2019/10/30 13:36:03 DEBUG : en07.data: Excluded
2019/10/30 13:36:03 DEBUG : en07.firefox: Excluded
2019/10/30 13:36:03 DEBUG : en07.kdbx: Excluded
2019/10/30 13:36:03 DEBUG : en07.keepass: Excluded
2019/10/30 13:36:03 DEBUG : en07.rclone: Excluded
2019/10/30 13:36:03 DEBUG : en07.userprofile: Excluded
2019/10/30 13:36:03 DEBUG : firefox: Excluded
2019/10/30 13:36:03 DEBUG : kdbx: Excluded
2019/10/30 13:36:03 DEBUG : keepass: Excluded
2019/10/30 13:36:03 DEBUG : one: Excluded
2019/10/30 13:36:03 DEBUG : rclone: Excluded
2019/10/30 13:36:03 DEBUG : 5 go routines active
2019/10/30 13:36:03 DEBUG : rclone: Version "v1.49.3" finishing with parameters ["c:\data\rclone\scripts\rclone.exe" "ls" "wasabiwest01:en07" "--include" "/zip/
" "--log-level=DEBUG" "--log-file=c:\data\rclone\scripts\rr\other\mount\logfile.txt" "--dry-run" "--log-level=DEBUG"]
2019/10/30 13:36:03 DEBUG : rclone: Version "v1.49.3" starting with parameters ["c:\data\rclone\scripts\rclone.exe" "ls" "wasabiwest01:en07" "--include" "/zip/" "--log-level=DEBUG" "--log-file=c:\data\rclone\scripts\rr\other\mount\logfile.txt" "--dry-run" "--log-level=DEBUG"]
2019/10/30 13:36:03 DEBUG : Using RCLONE_CONFIG_PASS password.
2019/10/30 13:36:03 DEBUG : Using config file from "c:\data\rclone\scripts\rclone.conf"
2019/10/30 13:36:04 DEBUG : andotp: Excluded
2019/10/30 13:36:04 DEBUG : en07.calibre: Excluded
2019/10/30 13:36:04 DEBUG : en07.data: Excluded
2019/10/30 13:36:04 DEBUG : en07.firefox: Excluded
2019/10/30 13:36:04 DEBUG : en07.kdbx: Excluded
2019/10/30 13:36:04 DEBUG : en07.keepass: Excluded
2019/10/30 13:36:04 DEBUG : en07.rclone: Excluded
2019/10/30 13:36:04 DEBUG : en07.userprofile: Excluded
2019/10/30 13:36:04 DEBUG : firefox: Excluded
2019/10/30 13:36:04 DEBUG : kdbx: Excluded
2019/10/30 13:36:04 DEBUG : keepass: Excluded
2019/10/30 13:36:04 DEBUG : one: Excluded
2019/10/30 13:36:04 DEBUG : 5 go routines active
2019/10/30 13:36:04 DEBUG : rclone: Version "v1.49.3" finishing with parameters ["c:\data\rclone\scripts\rclone.exe" "ls" "wasabiwest01:en07" "--include" "/zip/
" "--log-level=DEBUG" "--log-file=c:\data\rclone\scripts\rr\other\mount\logfile.txt" "--dry-run" "--log-level=DEBUG"]

From your debug output though, it looks like for some reason it is not accepting the folders with periods (.) in the name. That might be the problem.

I don't exactly know why it would be causing an issue though - it should't matter in that pattern
but I will do a quick test here to see if I can replicate that

Sorry, I see a mistake I made.
Definitely not the / at the start (this will match only top layer of root due to a special rule)

--include *zip*/**

should be correct - but this is almost the exact same you started with (and the difference should not be mattering)

thanks,
it is not because of a dot in the folder name
the folder firefox does not have a dot and there is a subfolder named zip inside it.
the ls command list not listing that zip subfolder.

i tried --include *zip*/** and still the exact same output each and every time.

%root%\rclone.exe ls  wasabiwest01:en07 --include "*zip*/**" 	%logfile% --dry-run --log-level=DEBUG
%root%\rclone.exe ls  wasabiwest01:en07 --include="/zip/"  		%logfile% --dry-run --log-level=DEBUG
%root%\rclone.exe ls  wasabiwest01:en07 --include="/*zip*/" 	%logfile% --dry-run --log-level=DEBUG
%root%\rclone.exe ls  wasabiwest01:en07 --include="/zip/*" 		%logfile% --dry-run --log-level=DEBUG
%root%\rclone.exe ls  wasabiwest01:en07 --include="/zip/**" 	%logfile% --dry-run --log-level=DEBUG
%root%\rclone.exe ls  wasabiwest01:en07 --include="/*zip*/**" 	%logfile% --dry-run --log-level=DEBUG

vvery strange because I can't replicate it... I will try with your exact folder structure... one moment