[Gluster-users] Quickest way to delete many small files

Stephan von Krawczynski skraw at ithnet.com
Wed Jun 12 19:45:56 UTC 2013

On Wed, 12 Jun 2013 14:55:23 -0300
Pablo <paa.listas at gmail.com> wrote:

> So combining the two approaches I think that this may be a better solution?
> tempdirname=`mktemp -d`
> mv <dir> $tempdirname
> mkdir <dir>
> # rm -rf <tempdirname>
> mkdir empty
> rsync -a --delete empty/ $tempdirname
> rmdir empty $tempdirname
> Regards,
> Pablo.

Ok, this is a heavy misinterpretation of my true intention.
I did _not_ intend to delete particularly fast, the sole idea of mv & mkdir
was to come up with the same but empty dir for _users_ as fast as possible.
And only _then_ throw away the old, probably unneeded original content.
So I thought the basic admin idea was to give the user as fast as possible
what he wants (empty dir) and deal with the rest cleanup later on.
And that's why I named it an admin question. Do something to make the user
happy, but indeed something completely different than what the user thought
was going on. And whatever idea you come up, you will not have your dir as
fast empty shown to the user as me with mv&mkdir :-)
And btw, this is exactly what I do suggest for delete/undelete implementation:
move the deleted something to a shadow dir where content is expelled based on
its age iff the real world tree needs more space.


More information about the Gluster-users mailing list