Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jun 2004 16:00:32 -0400
From:      Gerard Samuel <fbsd-questions@trini0.org>
To:        Richard Caley <rjc@caley.org.uk>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Means of traversing a directory
Message-ID:  <200406171600.32602.fbsd-questions@trini0.org>
In-Reply-To: <87acz2b6i6.fsf@pele.r.caley.org.uk>
References:  <200406170909.37669.fbsd-questions@trini0.org> <87acz2b6i6.fsf@pele.r.caley.org.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406171600.32602.fbsd-questions>