Date: Thu, 23 Oct 1997 16:36:01 +0930 From: Greg Lehey <grog@lemis.com> To: "Matthew D. Fuller" <fullermd@futuresouth.com> Cc: Shawn Ramsey <shawn@luke.cpl.net>, questions@FreeBSD.ORG Subject: Re: deleted huge directory Message-ID: <19971023163601.11925@lemis.com> In-Reply-To: <Pine.BSF.3.96.971023011454.29151C-100000@shell.futuresouth.com>; from Matthew D. Fuller on Thu, Oct 23, 1997 at 01:16:35AM -0500 References: <Pine.BSF.3.95.971022231126.26455B-100000@luke.cpl.net> <Pine.BSF.3.96.971023011454.29151C-100000@shell.futuresouth.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19971023163601.11925>