Skip to content

--delete-empty-src-dirs improvement on rclone move (--leave-root=false) #7478

Open

Description

@cberni

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

  • os/version: ubuntu 22.04 (64 bit)
  • os/kernel: 5.15.0-83-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.20.2
  • go/linking: static
  • go/tags: none

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.

rclone move /local/test/dir remote:bucket/test/dir --no-traverse --fast-list --delete-empty-src-dirs --leave-root=false -v -P
Error: unknown flag: --leave-root
Usage:
  rclone move source:path dest:path [flags]

Flags:
      --create-empty-src-dirs   Create empty source dirs on destination after move
      --delete-empty-src-dirs   Delete empty source dirs after move
  -h, --help                    help for move

Use "rclone [command] --help" for more information about a command.
Use "rclone help flags" for to see the global flags.
Use "rclone help backends" for a list of supported services.

2023/12/01 17:20:06 Fatal error: unknown flag: --leave-root

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions