Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

"find -mtime" differences AIX4 and AIX5

Posted on 2003-11-10
6
Medium Priority
?
4,008 Views
Last Modified: 2013-12-06
Hi!

The definition of "find -mtime" changed!

find all files changed between 24-48 hours
AIX4: find . -mtime 2
AIX5: find . -mtime 1

find all files changed between 48-72 hours
AIX4: find . -mtime 3
AIX5: find . -mtime 2

find all files changed between 0-24 hours
AIX4: find . -mtime 1
AIX5: find . -mtime 0

find all files changed between 0-48 hours
AIX4: find . -mtime -2
AIX5: ???
AIX5: find . -mtime -1 -> returns all files changes between 24-48
AIX5: find . -mtime -2 -> returns all files changes between 24-72

BUT HOW TO find all files between 0 and 48/72/... hours???

thx
michi
0
Comment
Question by:witty
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
6 Comments
 
LVL 38

Expert Comment

by:yuzh
ID: 9719366
Here's what you can do, create a stamp file first, than use find.
eg, to find all the files 0-72 hrs, you do: (I use ksh/bash/sh shell systax)

STAMP=`TZ=$TZ+72 date  +%Y%m%d%H%M`
touch -t $STAMP mystamp

find . -newer mystamp -print
0
 
LVL 38

Expert Comment

by:yuzh
ID: 9736303
how's it going, need more help?
0
 
LVL 1

Author Comment

by:witty
ID: 9741145
@yuzh:

thanks for your comment:
... but creating a temporary file is no solution :-(
any other idea?

thx
michi
0
 
LVL 38

Accepted Solution

by:
yuzh earned 500 total points
ID: 9744409
Well, I have not used an AIX box for a while now, and don't have AIX 5.x on hand
for testing:

In normal condition:

find . -mtime -n
should return all the files modified in 0 - n*24 hours (this working fine in Solaris,
HP-UX, FreeBDS, Linux, SCO ....!)

If "find" behave the way as you mentioned above,  you better use a tmp file.
(it cost you nothing 0 byte, if you use it in a script, you can clean it up
after "find"),  otherwise, you have to use "for/while" loop, to do multiple "find"!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question