Skip to content
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

Bug: add a --delete-empty-dirs flag on the move command instead of deleting empty dirs automatically #1854

Closed
ajkis opened this issue Nov 23, 2017 · 9 comments · Fixed by #1859
Assignees
Labels

Comments

@ajkis
Copy link

ajkis commented Nov 23, 2017

Latest rclone v1.38-181 include removal of empty folders once rclone move is finished, however that is causing problems if other apps expect those paths.

I use the following setup:
Sonarr is pointing to /storage/local/series
Radarr is pointing to /storage/local/movies
Rclone is moving from /storage/local remote:

Once rclone is finished it will delete all empty folder so in this case /storage/local

With previous version, I used script that would remove empty folders under ./local/movies & series.

It would be great if new flag was added that would skip removal of empty folders.

@ajkis
Copy link
Author

ajkis commented Nov 23, 2017

@ishuah is empty folder removal triggered after everything is finished or does folders get removed immediately. There could be an easy solution without the flag if those folders are removed after everything is moved since in that case we could recreate them at the end of script.

@ishuah
Copy link
Collaborator

ishuah commented Nov 23, 2017

Directory removal is triggered after transfer is finished.
You're proposing to create the deleted directories with your own script after move, right?

@ajkis
Copy link
Author

ajkis commented Nov 23, 2017

Is it after all transfers are finished or per transfer

eg if i do
rclone move /storage/local remote:

and its transferring
/storage/local/movies/Title1
/storage/local/series/TVshow1/Season 01

once ./movie/Title1 is transferred ( but series are still in progress ), will rclone immediately delete /storage/local/movies ... or that happens after all transfers are finished and then cleanup is preformed at the end.
If thats the case then I could just recreate missing folders after rclone is finished, otherwise I would need to cron or inotify script that will keep recreating folders as soon as they are deleted.

@ishuah
Copy link
Collaborator

ishuah commented Nov 23, 2017

Now I understand your question.
Directory deletion happens after transfers are completed, you can recreate the missing directories after rclone is done.

@l3uddz
Copy link

l3uddz commented Nov 23, 2017

i agree that it would be nicer if this option was itself a flag on the move command (disabled by default), e.g. --delete-empty-dirs as alot of people already use their own scripts to remove empty directories.

@ishuah
Copy link
Collaborator

ishuah commented Nov 23, 2017

@l3uddz great idea, I'm all for it.
what do you think, @ncw?

@ncw
Copy link
Member

ncw commented Nov 23, 2017

@ishuah a flag on just the move command is a good idea I think and saves the proliferation of global flags.

@ishuah ishuah changed the title Feature Requests: new flag that will prevent removal of empty folders once rclone move finished Feature Request: add a --delete-empty-dirs flag on the move command Nov 23, 2017
@ishuah ishuah self-assigned this Nov 23, 2017
@ishuah ishuah changed the title Feature Request: add a --delete-empty-dirs flag on the move command Bug: add a --delete-empty-dirs flag on the move command instead of deleting empty dirs automatically Nov 23, 2017
@ishuah ishuah added the bug label Nov 23, 2017
@ishuah
Copy link
Collaborator

ishuah commented Nov 23, 2017

Great! I'll put together a PR.

@ishuah
Copy link
Collaborator

ishuah commented Nov 28, 2017

Please find a beta version with a fix here: https://beta.rclone.org/v1.38-188-gaab8051f/ (Uploaded in 15-30 minutes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants