How to use rmdirs remove empty subdirectories only?


#1

For example, I have empty subdirectories /a/b and /a/c. How can I prevent the root directory /a from being deleted after running rclone rmdirs remote:/a?


#2

The easiest way us just to make it again afterwards with rclone mkdir remote:a or mkdir a if on the local FS.


#3

Thought this question has been asked enough times that I should probably put a flag on rmdirs - --leave-root - if you please make a new issue on github then we can do that!


#4

Thanks for the answer! My workaround for now is putting an empty file in the root directory so that running rmdirs won’t remove it. I will make a new issue on github soon.