From owner-freebsd-questions@FreeBSD.ORG Wed Jan 11 12:39:40 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 E577B16A41F for ; Wed, 11 Jan 2006 12:39:40 +0000 (GMT) (envelope-from norgaard@locolomo.org) Received: from strange.daemonsecurity.com (59.Red-81-33-11.staticIP.rima-tde.net [81.33.11.59]) by mx1.FreeBSD.org (Postfix) with ESMTP id 725AF43D48 for ; Wed, 11 Jan 2006 12:39:39 +0000 (GMT) (envelope-from norgaard@locolomo.org) Received: from [172.24.8.84] (generic.ATOSORIGIN.ES [212.170.156.200]) by strange.daemonsecurity.com (Postfix) with ESMTP id 17E192E0A5; Wed, 11 Jan 2006 13:39:36 +0100 (CET) Message-ID: <43C4FCB6.9020607@locolomo.org> Date: Wed, 11 Jan 2006 13:40:22 +0100 From: Erik Norgaard User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: chris@collins-ca.com References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: search by date X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2006 12:39:41 -0000 Chris Collins wrote: > Can somebody tell me how to search for files by the date they were created. > Maybe somebody has a script they have created and would like to share. I > have about 5000 files in different directories I would like to backup crated > prior to 2003 and then delete. Any ideas? Check find(1) Unfortunately if you try to specify a specific age this is not in Unix time but in 24h intervals relative to when find was started. The -newer option on the other hand allows you to find all files created/accessed/modified since the times of a given file. The idea is that if you do incremental backups, you stamp a file in the backup dir and use that as reference to find which files have been modified since last backup. Cheers, Erik