-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--delete-empty-src-dirs improvement on rclone move (--leave-root=false) #7478
Labels
Comments
nielash
added a commit
to nielash/rclone
that referenced
this issue
Feb 6, 2024
…ixes rclone#7478 Before this change, it was not always possible to delete an empty source root directory during `rclone move`. Furthermore, the behavior was inconsistent based on whether the move was performed server-side or via the fallback to copy + delete. After this change, a --leave-root flag is added to control whether --delete-empty-src- dirs deletes an empty src root. (It has no effect if --delete-empty-src-dirs=false or if the src root isn't empty.) Note that --leave-root defaults to false, which is arguably a breaking change, although also arguably not, since the prior behavior was already inconsistent (the root was, in fact, still deleted for server-side moves without filters.) Defaulting to false also makes it consistent with the identical option in `rclone rmdirs`. This setting should be particularly helpful for users wanting to rename a directory in place. Note that both --delete-empty-src-dirs and --leave-root are effectively ignored for server-side directory move operations without filters, which always use the equivalent of --delete-empty-src-dirs=true --leave-root=false. (This is not a change, but was not previously documented.)
5 tasks
nielash
added a commit
to nielash/rclone
that referenced
this issue
Feb 6, 2024
…ixes rclone#7478 Before this change, it was not always possible to delete an empty source root directory during `rclone move`. Furthermore, the behavior was inconsistent based on whether the move was performed server-side or via the fallback to copy + delete. After this change, a --leave-root flag is added to control whether --delete-empty-src- dirs deletes an empty src root. (It has no effect if --delete-empty-src-dirs=false or if the src root isn't empty.) Note that --leave-root defaults to false, which is arguably a breaking change, although also arguably not, since the prior behavior was already inconsistent (the root was, in fact, still deleted for server-side moves without filters.) Defaulting to false also makes it consistent with the identical option in `rclone rmdirs`. This setting should be particularly helpful for users wanting to rename a directory in place. Note that both --delete-empty-src-dirs and --leave-root are effectively ignored for server-side directory move operations without filters, which always use the equivalent of --delete-empty-src-dirs=true --leave-root=false. (This is not a change, but was not previously documented.)
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The associated forum post URL from
https://forum.rclone.org
https://forum.rclone.org/t/rclone-rcd-move-folder-doesnt-delete-empty-source-folder/15080
What is your current rclone version (output from
rclone version
)?rclone v1.62.2
What problem are you are trying to solve?
delete the root directory after completed move if the folder is empty. There will be some cases that can be left files when using filters.
rclone move /local/test/dir remote:bucket/test/dir
the folder
/local/test/dir
is leaved empty.How do you think rclone should be changed to solve that?
just remove the root directory if the folder is empty.
--leave-root=false
flag as @ncw noted.How to use GitHub
The text was updated successfully, but these errors were encountered: