Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Jan 2001 17:07:41 -0500
From:      "Peter Brezny" <peter@sysadmin-inc.com>
To:        <freebsd-questions@freebsd.org>
Subject:   find shell script problem
Message-ID:  <006101c08a3f$e6f40b60$46010a0a@sysadmininc.com>

next in thread | raw e-mail | index | archive | help
I would like to be able to automatically delete directories within a single
subdirectory once they are more than three months old.

I've been reading the man page for date and find and have some ideas but am
lacking in shell scripting knowledge.

my best attempt (which doesn't work) is:

find /dir1/ \! -newer `date -v-3m` -delete

This however returns the actual date 3 months ago rather than the date of
any directory 3 months ago.  I don't know how to tell find to apply this
date to any directory it finds under /dir1/

TIA

Peter Brezny
SysAdmin Services Inc.



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?006101c08a3f$e6f40b60$46010a0a>