Re: finding files modified yesterday

From: Green, Simon (SGreen@KRAFTEUROPE.COM)
Date: Tue Dec 10 2002 - 10:38:36 EST


You're on the right track. Use touch -t, but set it to midnight yesterday.
Using one of my systems in Switzerland, (I assume that's where you are):

echo TZ
MET-1METDST,M3.5.0,M10.5.0

touch -t `ksh TZ=MET23METDST,M3.5.0,M10.5.0 date +%m%d`0000 /tmp/timestamp

To see yesterday's date, just add 24 to the TZ offset and let date take care
of the rest.

If you were smart, you could probably write a script to automatically
generate an appropriate TZ parameter for any given offsest. I'm not sure
it's worth the effort, though.

Using this with find will give you everything modified since midnight
yesterday, including files modified today. I'm not sure that there's any
easy way of avoiding that, but you ought to be considering that a file that
was modified yesterday was *also* modified today.

If you have a lot of files and really only want those modified yesterday you
could generate two lists - one for files modified since midnight yesterday;
one for midnight today - and run comm against them.

Simon Green
Philip Morris ITSC Europe

AIX-L Archive at http://marc.theaimsgroup.com/?l=aix-l
<http://marc.theaimsgroup.com/?l=aix-l&r=1&w=2> &r=1&w=2
AIX FAQ at http://www.faqs.org/faqs/aix-faq/
<http://www.faqs.org/faqs/aix-faq/>

N.B. Unsolicited email from vendors will seldom be appreciated.

-----Original Message-----
From: Holger.VanKoll@SWISSCOM.COM [mailto:Holger.VanKoll@SWISSCOM.COM]
Sent: 10 December 2002 14:38
To: aix-l@Princeton.EDU
Subject: finding files modified yesterday

Hello,

I need to find all files in /somewhere that have been modified yesterday.

So far I use touch -t todays_date_0:00 /tmp/timestamp and find -new
/tmp/timestamp to find all files modified earlier than today.

How can I filter out the files modified 2,3,4... days before?
I should have a way that does not rely on certain TZ or LC* settings.



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:24 EDT