-
Notifications
You must be signed in to change notification settings - Fork 170
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
Deleting or restoring a trash item does not clean up empty dirs #9271
Comments
I don't know if it is worth a cli tool if # find /home/jfd/.ocis/storage/users/spaces/so/me-admin-user-id-0000-000000000000/trash/* -type d -empty
/home/jfd/.ocis/storage/users/spaces/so/me-admin-user-id-0000-000000000000/trash/55/39/3d/dd
/home/jfd/.ocis/storage/users/spaces/so/me-admin-user-id-0000-000000000000/trash/66/ab/b3/ab can be used to list all ampty dirs and # find /home/jfd/.ocis/storage/users/spaces/so/me-admin-user-id-0000-000000000000/trash/* -type d -empty -delete will even delete them recursively: # find /home/jfd/.ocis/storage/users/spaces/so/me-admin-user-id-0000-000000000000/trash/* -type d -empty beware that leaving out the # mkdir -p /tmp/1/2/3/4
# find /tmp/1 -type d -empty
/tmp/1/2/3/4
# find /tmp/1 -type d -empty -delete
# find /tmp/1 -type d -empty
find: ‘/tmp/1’: Datei oder Verzeichnis nicht gefunden
# mkdir -p /tmp/1/2/3/4
# find /tmp/1/* -type d -empty -delete
# find /tmp/1 -type d -empty
/tmp/1 so to clean up all trash folders this should work: find /var/lib/ocis/storage/users/spaces/*/*/trash/* -type d -empty # to be safe do a sanity check here
find /var/lib/ocis/storage/users/spaces/*/*/trash/* -type d -empty -delete |
can be closed with the next reva bump, unless @d7oc thinks we should add a dedicated CLI command |
I still vote for a CLI command. Not for myself, but I think our final approach is still to also address other users and as long as we don't want to document the workarounds presented here in our official documentation we need a CLI tool for them. |
@tbsbdr not for me to decide |
👍 lets have a CLI |
We will do the CLI in a follow up. |
Closing here. |
When deleting or restoring an entry from the trash directory of a space we do not clean up empty nodes. This clutters the trash bin directory and slows down the listing because it has to glob all empty dirs. Which is even slower on NFS.
Another possibility to speed up listing the trashbin is to not shard the nodes in the trashbin dir and then cache the directory listing until the mtime of the
./trash
directory changes. We could also do the caching with the sharded node layout by touching the trash directory, whenever a file is added or removed from the trash.But removing empty dirs should be the first step:
The text was updated successfully, but these errors were encountered: