From owner-freebsd-questions@FreeBSD.ORG Tue Jul 6 20:00:40 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD00116A4CF for ; Tue, 6 Jul 2004 20:00:40 +0000 (GMT) Received: from kanga.honeypot.net (kanga.honeypot.net [208.162.254.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5D66C43D1F for ; Tue, 6 Jul 2004 20:00:29 +0000 (GMT) (envelope-from kirk@strauser.com) Received: from localhost (localhost [127.0.0.1]) by kanga.honeypot.net (Postfix) with ESMTP id 0F90EB9A8 for ; Tue, 6 Jul 2004 15:00:28 -0500 (CDT) Received: from kanga.honeypot.net ([127.0.0.1]) by localhost (kanga.honeypot.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 38780-01 for ; Tue, 6 Jul 2004 15:00:27 -0500 (CDT) Received: from janus.daycos.com (outbound.daycos.com [204.26.70.70]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by kanga.honeypot.net (Postfix) with ESMTP id 5655BB8F6 for ; Tue, 6 Jul 2004 15:00:27 -0500 (CDT) From: Kirk Strauser To: freebsd-questions@freebsd.org Date: Tue, 6 Jul 2004 15:00:23 -0500 User-Agent: KMail/1.6.2 References: <3703.209.167.16.15.1089123354.squirrel@209.167.16.15> In-Reply-To: <3703.209.167.16.15.1089123354.squirrel@209.167.16.15> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200407061500.23299.kirk@strauser.com> X-Virus-Scanned: by amavisd-new at honeypot.net Subject: Re: Removing thousands of files using rm X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2004 20:00:41 -0000 On Tuesday 2004-07-06 09:15 am, Steve Bertrand wrote: > The directory I am trying to remove the files from is always hot, so > deleting the directory is unfortunately not an option. (I don't think). If the directory is /var/tmp/foo, what about making "foo" a symlink to "foo.0", then do something like: # mkdir foo.1 # ln -fsn foo.1 foo # rm -rf foo.0 I'm reasonably sure that the second line is an atomic operation, although I don't have the time to verify it just now. I'm sure someone will correct me if I'm wrong. :) Anyway, /var/tmp/foo would always exist and point to a valid destination. You'd have your "hot" directory while being able to move the old version out of the way for deletion at your leisure. -- Kirk Strauser