LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-01-2011, 02:03 AM   #1
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
find -atime


Hi all

I'm using KSH and i need to have my files listed that are 1 hour old.
So if a file has been accessed 30 minutes ago, i don't want that file in my list, but if a file has been accessed 60+ minutes ago, he needs to be in that list (also if the file has been accessed months ago)

so, what i've got now is:
Code:
test=`find /some/folder -atime 1`
echo $test
my result is on a good way, meaning that i get some files, but not all of them.. so i geuss i'm missing something.

I've also looked at the manpages for find in the KSH
Quote:
-atime n
True if the file access time subtracted from
the initialized time is n-1 to n multiples of
24 h.
The initialization time shall be a
time between the invocation of the find
utility and the first access by that
invocation of the find utility to any file
specified by its path operands. The access
time of directories in pathname_list is
changed by find itself.
what do they mean with that (bold section)?

thx
 
Old 04-01-2011, 06:21 AM   #2
ongte
Member
 
Registered: Jun 2009
Location: Penang, Malaysia
Distribution: Mageia, CentOS, Ubuntu
Posts: 468

Rep: Reputation: 72
If you need it in minutes. You should use '-amin' not '-atime' which is in days.
You also have to use + / - for more than or less than. You can even specify a range.

For more than 60 mins:
Quote:
# find /some/folder -amin +60
For more than 30 mins but less then 60 mins:
Quote:
# find /some/folder -amin +30 -amin -60
The last I tried this, the find program itself accesses the files to read this information. So after running this once, your access time will be updated. For this reason, you probably might want to use '-mmin' instead if it makes sense.

Last edited by ongte; 04-01-2011 at 06:26 AM.
 
Old 04-01-2011, 06:23 AM   #3
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416

Original Poster
Blog Entries: 2

Rep: Reputation: 12
yes i know, but i'm using the Korn shell on a HP-UX, and if i look on the man pages of that server, i don't have the options you describe
 
Old 04-01-2011, 06:29 AM   #4
ongte
Member
 
Registered: Jun 2009
Location: Penang, Malaysia
Distribution: Mageia, CentOS, Ubuntu
Posts: 468

Rep: Reputation: 72
Oops. Sorry then, no idea about HP-UX. Haven't touched one of those in 10 years.
 
Old 04-01-2011, 06:32 AM   #5
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416

Original Poster
Blog Entries: 2

Rep: Reputation: 12
hehe np ^^

do you know something about NAGIOS?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
atime updates umailtonikhil *BSD 4 09-10-2007 07:57 AM
atime update information umailtonikhil Solaris / OpenSolaris 2 09-07-2007 10:08 AM
modify atime farslayer Linux - General 3 01-19-2007 12:27 PM
Find with atime to return files before 2005 neville310 Programming 1 12-09-2005 05:34 AM
Atime updates not implemented yet - disabling them Repeater Linux - Newbie 0 10-24-2004 12:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration