How to copy only content not the directories?

i have scripts (.sh) in my home folder.
i want to upload on the sh file. when i upload it its also copying sub-directories.
is there a flag to do this?
tried “rclone copy source:path/ dest:script --include “*.sh” --max-depth 1”

/path/a.sh
/path/b.sh
/path/c.sh
/path/dir1/d.sh
/path/dir2/
/path/dir3/

desired output:
/scripts/a.sh
/scripts/b.sh
/scripts/c.sh
/scripts/d.sh

actual output:
/scripts/a.sh
/scripts/b.sh
/scripts/c.sh
/scripts/dir1/d.sh
/scripts/dir2/
/scripts/dir3/

Which version of rclone are you using?

I think this is probably a bug - can you please make a new issue on github about this please?

The log would be a bit odd as:

/path/dir1/d.sh

would be 3 levels down so you’d never copy that with max-depth 1

You want to copy everything and ignore the parent path and just leave is with no path it seems.

Actually using --include /*.sh would be better I think.

1 Like

i was trying “\*.sh” before

/*.sh is working. but without d.sh.
well this result is enough for my use. i was very optimistic about including d.sh inside scripts folder anway.
thank you

1 Like