From owner-freebsd-questions Thu Oct 23 00:06:22 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id AAA04224 for questions-outgoing; Thu, 23 Oct 1997 00:06:22 -0700 (PDT) (envelope-from owner-freebsd-questions) Received: from freebie.lemis.com (gregl1.lnk.telstra.net [139.130.136.133]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id AAA04219 for ; Thu, 23 Oct 1997 00:06:17 -0700 (PDT) (envelope-from grog@freebie.lemis.com) Received: (from grog@localhost) by freebie.lemis.com (8.8.7/8.8.5) id QAA27687; Thu, 23 Oct 1997 16:36:01 +0930 (CST) Message-ID: <19971023163601.11925@lemis.com> Date: Thu, 23 Oct 1997 16:36:01 +0930 From: Greg Lehey To: "Matthew D. Fuller" Cc: Shawn Ramsey , questions@FreeBSD.ORG Subject: Re: deleted huge directory References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.84e In-Reply-To: ; from Matthew D. Fuller on Thu, Oct 23, 1997 at 01:16:35AM -0500 Organisation: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 WWW-Home-Page: http://www.lemis.com/~grog Fight-Spam-Now: http://www.cauce.org Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Thu, Oct 23, 1997 at 01:16:35AM -0500, Matthew D. Fuller wrote: > On Wed, 22 Oct 1997, Shawn Ramsey wrote: > >>>> Does anyone have any suggestions for deleting a huge directory? The >>>> direcory is /var/news/spool/control/cancel. The directory is too large to >>>> even do a ls. If I try doing ls, it eats up all the avail. RAM(140+mb) and >>>> hangs. Anyone? I would try a wildcard, but I don't know what the filenames >>>> are. (This is a very large news server, and this directory has never been >>>> touch as far as I know.) >>> >>> Dear god. >>> If you don't mind, I'll just borrow all that space..... >>> Can you get a file listing by echo * > /place/some/file.list ? >> >> Can anyone tell me exactly what this directory is for? This months >> Boardwatch in ISP Tech Talk, the author recommends deleting this directory >> daily. And this has never been deleted, as far as I know. Or it has been a >> very long time. Does the news server read this directory during >> news.dailt? Expires have been taking FOREVER lately. I suspect this may be >> a reason. (Sorry for the off-topicness, but how to delete the directory is >> ontopic. :) ) > > Don't know if this helps, but the reason I suggested echo'ing * (all > files, of course) into a file is to see if you could do this: > rm 'cat /place/some/file/list' > or something similar; I'm not exactly an expert when it comes to piping > stuff from a file. > Someone else? Can this be done, and could it work? You can ls larger directories than you can expand with *. The latter is limited to ARG_MAX characters, including \0 at the end of the strings. ARG_MAX is defined in /usr/include/sys/syslimits.h: #define ARG_MAX 65536 /* max bytes for an exec function */ At a guess, the names in the directory are an order of magnitude longer than that. Greg