From owner-freebsd-questions@FreeBSD.ORG Thu Jun 17 20:01:04 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 5850716A4CE for ; Thu, 17 Jun 2004 20:01:04 +0000 (GMT) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3261643D46 for ; Thu, 17 Jun 2004 20:01:04 +0000 (GMT) (envelope-from fbsd-questions@trini0.org) Received: from hivemind.trini0.org (trini0.org[65.34.205.195]) by comcast.net (rwcrmhc12) with ESMTP id <200406172000330140021d8pe>; Thu, 17 Jun 2004 20:00:33 +0000 Received: from gladiator.trini0.org (gladiator.trini0.org [192.168.0.3]) by hivemind.trini0.org (Postfix) with ESMTP id CE496D2; Thu, 17 Jun 2004 16:00:32 -0400 (EDT) From: Gerard Samuel To: Richard Caley Date: Thu, 17 Jun 2004 16:00:32 -0400 User-Agent: KMail/1.6.2 References: <200406170909.37669.fbsd-questions@trini0.org> <87acz2b6i6.fsf@pele.r.caley.org.uk> In-Reply-To: <87acz2b6i6.fsf@pele.r.caley.org.uk> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200406171600.32602.fbsd-questions@trini0.org> cc: freebsd-questions@freebsd.org Subject: Re: Means of traversing a directory 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: Thu, 17 Jun 2004 20:01:04 -0000 On Thursday 17 June 2004 10:31 am, Richard Caley wrote: > In article <200406170909.37669.fbsd-questions@trini0.org>, Gerard Samuel > (gs) writes: > > gs> Im running tar(1) to make a tar ball of a directory using the > gs> --newer-mtime to only get newer files after a specified date. > gs> Unfortunately, it also creates unwanted "empty" directories. > > Have you tried using find? > > If a relative time is good enough > > find DIR -type f -mtime -6 > > if you need to specify a time and date, I think the only way is to use > touch to makea file at the right date then use find's -newer test. Well I made an ugly script, (50 lines), but it works. Ill have to investigate on simplifying it, along with implementing absolute time with find, as that would eliminate me from using tar to get the newest files. But the find commands that I used were -> # Blatantly remove CVS directories find -d ./ -type d -regex '.*/CVS' -exec rm -rf {} \; # Remove empty directories find -d ./ -type d -exec rmdir {} \; So Im good for now. Thanks