Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Files and Date Ranges?

Status
Not open for further replies.

xhonzi

Programmer
Jul 29, 2003
196
US
Hello,
I have a ksh script that gathers logs. Until recently, it's only function has been to gather the most recent of several different types. I have been tasked with changing it so that it can also search for logs in a user specified date range. I know about finding files with +ctime and such, but my problem with these is
1) that the dates are relative to system time
2) that you can't specify minutes and hours along with days

I'm prepared to write some lengthy code to do this (essentially grepping on an `ls -ltr`'s date/time columns) but I figured there had to be an easier way. I was just looking at this other post: and I'm going to attempt to adapt it. Thanks for any replies.

Xhonzi
 
man touch
man find

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Okay, that's no help whatsoever. I mentioned in my first post that 'find' doesn't do what I need it to do. Or if it does, I don't see how to do from the 'find' man page.

Xhonzi
 
Provided you know how to play with the touch command you may consider a combination of -newer and ! -newer primaries.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top