From: Mat Harris Subject: Re: oldest file Date: Thu, 6 Feb 2003 16:42:54 +0000 Sender: linux-admin-owner@vger.kernel.org Message-ID: <20030206164254.GA12196@genestate.com> References: <20030206100116.GA11904@genestate.com> <5.1.1.6.0.20030206082853.01cef8c8@mustang> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/9DWx/yDrRhgMJTb" Return-path: Content-Disposition: inline In-Reply-To: <5.1.1.6.0.20030206082853.01cef8c8@mustang> List-Id: To: Scott Taylor Cc: linux-admin@vger.kernel.org --/9DWx/yDrRhgMJTb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable yes but the problem with that is that the day could be of variable size and I can't remove more than necessary so removing day 20 may be equivalent to removing days 19-15 On Thu, Feb 06, 2003 at 08:37:55 -0800, Scott Taylor wrote: > At 02:01 AM 2/06/03, Mat Harris wrote: > >i am sure this has been asked before, but I can't find trace of it in any > >archives. > > > >I need to find the oldest directory inside multiply subdirectories. Perh= aps > >I should explain... > > > >I have /home/cams/ > >inside that dir is four other dirs: cam1 cam2 cam3 cam4 > >inside each of those is a directory structure like: year/day-date/ > > > >i want to run a script that searches for the oldest day in each cam > >directory. >=20 > What happens if the oldest day is the only file and that file is today's? >=20 > Wouldn't you rather just remove all files older than X number of days? Y= ou=20 > could do this with the find command; find files changed 20 days ago and= =20 > more: > find /home/cams/ -ctime +20 -exec rm -rf {} \; >=20 > for more info: > man find >=20 >=20 >=20 > - > To unsubscribe from this list: send the line "unsubscribe linux-admin" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html --=20 Mat Harris OpenGPG Public Key ID: C37D57D9 mat.harris@genestate.com www.genestate.com=09 --/9DWx/yDrRhgMJTb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE+QpCNEsYvZsN9V9kRAj2fAKC42+hDbMpc+LSs2MgV2Jdvtfv07wCfcOho oaA1+YYZeow9m4Zqip2NzRs= =qHrN -----END PGP SIGNATURE----- --/9DWx/yDrRhgMJTb--