From owner-freebsd-stable@FreeBSD.ORG Thu Jan 20 11:30:33 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5D0B916A4CE for ; Thu, 20 Jan 2005 11:30:33 +0000 (GMT) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F05043D6B for ; Thu, 20 Jan 2005 11:30:32 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (ezklyv@localhost [127.0.0.1]) by lurza.secnetix.de (8.12.11/8.12.11) with ESMTP id j0KBUKwB066100 for ; Thu, 20 Jan 2005 12:30:20 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.12.11/8.12.11/Submit) id j0KBUKMZ066099; Thu, 20 Jan 2005 12:30:20 +0100 (CET) (envelope-from olli) Date: Thu, 20 Jan 2005 12:30:20 +0100 (CET) Message-Id: <200501201130.j0KBUKMZ066099@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG In-Reply-To: <20050120094551.GK79646@cirb503493.alcatel.com.au> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.5.4-20000523 ("1959") (UNIX) (FreeBSD/4.10-RELEASE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Subject: Re: Very large directory X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2005 11:30:33 -0000 Peter Jeremy wrote: > On Wed, 2005-Jan-19 21:30:53 -0600, Phillip Salzman wrote: > > They've been running for a little while now - and recently we've noticed a > > lot of disk space disappearing. Shortly after that, a simple du into our > > /var/spool returned a not so nice error: > > > > du: fts_read: Cannot allocate memory > > > > No matter what command I run on that directory, I just don't seem to have > > enough available resources to show the files let alone delete them (echo *, > > ls, find, rm -rf, etc.) > > I suspect you will need to write something that uses dirent(3) to scan > the offending directory and delete (or whatever) the files one by one. > > Skeleton code (in perl) would look like: > [...] I would suggest trying this simple hack: cd /var/spool/directory ; cat . | strings | xargs rm -f It's a dirty hack, but might work, if the file names in that directory aren't too strange (no spaces etc.). Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell