From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1GSz9k-0002bY-77 for garchives@archives.gentoo.org; Thu, 28 Sep 2006 16:54:40 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.8/8.13.6) with SMTP id k8SGrS1v004816; Thu, 28 Sep 2006 16:53:28 GMT Received: from cranium.sybase.co.za (sqlprd.sybase.co.za [192.96.139.1]) by robin.gentoo.org (8.13.8/8.13.6) with ESMTP id k8SGlcmG002622 for ; Thu, 28 Sep 2006 16:47:40 GMT Received: from localhost (cranium.sybase.co.za [127.0.0.1]) by cranium.sybase.co.za (Postfix) with ESMTP id E619783452 for ; Thu, 28 Sep 2006 18:51:40 +0200 (SAST) X-Virus-Scanned: amavisd-new at sybase.co.za Received: from cranium.sybase.co.za ([127.0.0.1]) by localhost (cranium.sybase.co.za [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PHx0LY+nkGS7 for ; Thu, 28 Sep 2006 18:51:32 +0200 (SAST) Received: from bard.sybase.co.za (bard.sybase.co.za [192.168.2.6]) by cranium.sybase.co.za (Postfix) with ESMTP id 781FF83442 for ; Thu, 28 Sep 2006 18:51:32 +0200 (SAST) Received: from stevevw.sybase.co.za ([192.168.2.142]) by bard.sybase.co.za with Microsoft SMTPSVC(6.0.3790.1830); Thu, 28 Sep 2006 18:49:17 +0200 From: Alan McKinnon To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] date-specific cp/mv Date: Thu, 28 Sep 2006 18:47:52 +0200 User-Agent: KMail/1.9.4 References: <20060928161644.79743.qmail@web31713.mail.mud.yahoo.com> In-Reply-To: <20060928161644.79743.qmail@web31713.mail.mud.yahoo.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200609281847.52901.alan@linuxholdings.co.za> X-OriginalArrivalTime: 28 Sep 2006 16:49:17.0609 (UTC) FILETIME=[09979190:01C6E31E] X-Archives-Salt: d1699a8b-a7b3-4c2f-845b-07b95ef45e51 X-Archives-Hash: 05a551e612bffb46d9c296faf86acece On Thursday 28 September 2006 18:16, maxim wexler wrote: > Hi group, > > I'd like to be able to cp or mv certain files from a > dir according to their timestamp. > > man cp mentions the '--preserve' option but I don't > think that's what I need. > > Does somebody know of some sort of script or perl or > python pass that'll do it? use find with the time-related options and -exec. To move everything in ~/mystuff that's older than 3 days (72 hours) to ~/backup, you could use find ~/mystuff -type f -mtime 72 -exec mv {} ~/backup \; find has many options related to searching by time (hours, minutes, etc) and you can select by atime, ctime or mtime. It's all in the man page alan -- gentoo-user@gentoo.org mailing list