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

Adding tool mergerfs.consolidate-dirs #121

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

magma1447
Copy link

Not sure if this is of interest, but I have been missing such tool several times myself. For different reasons I have directories that has been split up that shouldn't be, and I figure this is the solution. It seems like more than me have thought that the existing consolidate tool does this. If you don't want to accept the pull request because you don't think the tool belongs, that's more than fine. I will then just keep it in my fork, primarily for myself, but also for others who look hard enough.

The tool takes the size per source device into consideration instead of just moving the data onto a random device, or the one with the most disk space available.

Pardon my Python. It's not my language and I use it about once per year only. I tried my best to follow your code standards and write as similar code as I could. Also, since I copy pasted quite a lot from the existing tools most of the code should be recognizable. I think I have cleaned out all unused functions.

Things it doesn't do that potentially would be wise:

  • Check disk space available before starting to move data. However, using rsync nothing bad should happen from it, besides potentially leaving some duplicates.
  • A parameter to choose to always move to the drive with the most space available instead of the one holding most of the data would have been nice. But since my Python skills are quite low and I didn't have the need myself I left that one out.
  • I am using rsync ... && rmdir <dir> as a sub-process call. I guess one could argue that it would be better to call rsync and then unlink the directory using Python. I deliberately chose this approach though.

@trapexit
Copy link
Owner

Can you explain what is different with this tool vs the existing one?

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

Successfully merging this pull request may close these issues.

2 participants