From owner-freebsd-hackers Thu Aug 21 05:45:50 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id FAA18290 for hackers-outgoing; Thu, 21 Aug 1997 05:45:50 -0700 (PDT) Received: from marathon.tekla.fi (marathon.tekla.fi [192.98.7.5]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id FAA18280 for ; Thu, 21 Aug 1997 05:45:42 -0700 (PDT) Received: from poveri.tekla.fi (poveri.tekla.fi [192.98.7.19]) by marathon.tekla.fi (8.8.7/8.8.7) with SMTP id PAA27232 for ; Thu, 21 Aug 1997 15:37:36 +0300 From: Sakari Jalovaara Received: by poveri.tekla.fi; (5.65v3.2/1.1.8.2/20Aug96-0557PM) id AA04003; Thu, 21 Aug 1997 15:37:36 +0300 Date: Thu, 21 Aug 1997 15:37:36 +0300 Message-Id: <9708211237.AA04003@poveri.tekla.fi> To: freebsd-hackers@FreeBSD.ORG Subject: Re: More info on slow "rm" times with 2.2.1+. Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >> Isn't there a command (which could be run in >> daily, or weekly, or something) that goes through a directory (or many) and >> optimize the space they take? >> >> If there isn't... why? And would it be hard to write? OLD=old-directory NEW=some-unique-name-$$ mkdir "$NEW" mv "$OLD"/* "$NEW" # You'd need a little something called "statf" here # `statf "chmod %m $NEW; chown %u $NEW; chgrp %g $NEW" "$OLD"` rmdir "$OLD" mv "$NEW" "$OLD" You'd have to make sure there are no other processes going through the directory at the time, though. I vaguely recall some UNIX variant having Amazing Automagically Shrinking Directories but I can't remember which one. ++sja