Copying folder structure only between remotes

What is the problem you are having with rclone?

I'm trying to make a copy of folder structure of the source remote to the destination one without doing anything with the files inside. Is there any efficient way to do this work ?

According to this topic, Nick has suggested a method

rclone copy FROM: TO: --min-size 5000G --create-empty-src-dirs

But here is my problem. Assuming the FROM remote has 10 sub-folders and 10000 files inside, it will take forever to run the code because it has to check all 10000 files instead of directly creating 10 folders only.

I've come up with an idea that I could use rclone lsf --dirs-only -R FROM: > folders.txt, and then one by one using rclone mkdir FROM:/a/folder/path for all the paths in the file folders.txt. But in my opinion, this is still not the best way to go, especially when the remote has a large amount of folders.

Suggestion: the command rclone mkdir can be used with the flag --files-from like this

rclone mkdir FROM: --files-from folders.txt

What is your rclone version (output from rclone version)

rclone v1.54.1

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

Which OS you are using and how many bits (eg Windows 7, 64 bit)

linux/amd64

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

Google Drive (and others in the future)

(thank you first and sorry for my bad English)

hello and welcome to the forum,

best to re-post this as a feature, not help and support

you can click the pencil at the top of the post and change that or if you want, i can do that for you.
image

1 Like

Thank you,
I've fixed the category. Although I think this topic is more like help and support rather than a feature

you do not have to change the category,.

so what is it you need help with?

If you want to make this more efficient then start an rclone rcd and then use rclone rc operations/mkdir to create the directories. This would be as efficient as getting rclone mkdir to understand --files-from.

1 Like

Thank you very much. This method works like a champ now

1 Like