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

Extend mergerfs.dedup to folders #23

Open
vejnar opened this issue Sep 10, 2016 · 5 comments
Open

Extend mergerfs.dedup to folders #23

vejnar opened this issue Sep 10, 2016 · 5 comments

Comments

@vejnar
Copy link

vejnar commented Sep 10, 2016

Hi,

mergerfs.dedup is very useful for files. But it doesn't take care of folders.

When a folder is created on multiple volumes, for instance to split the content of a folder among these volumes, and some of this content is removed, empty folders on some volume(s) remain(s). It would be great to remove these unnecessary empty folders.

Thanks. And thanks to develop mergerfs, it's great!

@trapexit
Copy link
Owner

You want to clean up directories on one drive that have data on others? The problem is that with path preserving those empty directories matter.

It can be done but it would have an effect on placement for path preserving.

Can also do a find -type d -empty -delete in the source paths.

@vejnar
Copy link
Author

vejnar commented Sep 13, 2016

You want to clean up directories on one drive that have data on others?

Yes

The problem is that with path preserving those empty directories matter.

Could you please explain why? The folder exists with data on another drive. If it exists empty on another drive, is that not redundant?

Can also do a find -type d -empty -delete in the source paths.

No. That would remove also actual empty folder, not just redundant folder.

@trapexit
Copy link
Owner

Path preserving policies (generally) only consider drives with the path in question.

https://github.com/trapexit/mergerfs#policy-descriptions

If the directory is removed that drive would now not be considered and could break the intentions of the user given the policy.

I'm not saying that the feature isn't useful in so much that in a targeted way it can help clean up. Just that it could lead to issues if used without understanding that impact.

@vejnar
Copy link
Author

vejnar commented Sep 22, 2016

Thanks for the explanation.

As an option to clean up, this would still be very useful IMHO.

If you plan to implement it, that would be appreciated. Otherwise please close this issue.

@chapmanjacobd
Copy link

removing nested empty folders is a bit complicated. This is the best solution I've found thus far:

yes | bfs -nohidden -type d -exec bfs -f {} -not -type d -exit 1 \; -prune -ok bfs -f {} -type d -delete \;

https://github.com/tavianator/bfs

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

No branches or pull requests

3 participants