From owner-freebsd-questions Mon Jan 29 14: 9: 0 2001 Delivered-To: freebsd-questions@freebsd.org Received: from virtual.sysadmin-inc.com (lists.sysadmin-inc.com [209.16.228.140]) by hub.freebsd.org (Postfix) with ESMTP id 23CFC37B698 for ; Mon, 29 Jan 2001 14:08:43 -0800 (PST) Received: from wkst (virtual2.sysadmin-inc.com [209.16.228.145]) by virtual.sysadmin-inc.com (8.9.1/8.9.1) with SMTP id RAA24010 for ; Mon, 29 Jan 2001 17:09:06 -0500 Reply-To: From: "Peter Brezny" To: Subject: find shell script problem Date: Mon, 29 Jan 2001 17:07:41 -0500 Message-ID: <006101c08a3f$e6f40b60$46010a0a@sysadmininc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Importance: Normal Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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