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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File modified time later than accessed time

Status
Not open for further replies.

LeeHagen

IS-IT--Management
Sep 20, 2002
22
0
0
US
We delete various files each night that are older than a specified access time. I'm seeing files that have a modification and update time that are later than the last access time. How can this be true? We are running AIX 5.1 which is pretty much up to date on patches.
 
can you list how you are deleteing old files and which files
have access times later than the last access times.
 
Here is an example of one of the files that we delete and how we delete it. The find command is finding exactly what it supposed to be finding. The problem lies in the fact that somehow some of the files are modified without changing the access time. I ruled out cp, mv, touch, cat, vi and chmod.

Command used to delete files using cron....................

find /u02/prodcomn/admin/log -name '*.*' -atime +7 -exec rm {} \;

Example of file which will get deleted...................

$ ls -l /u02/prodcomn/admin/log/l536124.req
-rw-r--r-- 1 oracle dba 2088804 Mar 12 09:41 /u02/prodcomn/admin/log/l536124.req

$ ls -lu /u02/prodcomn/admin/log/l536124.req
-rw-r--r-- 1 oracle dba 2088804 Mar 5 04:04 /u02/prodcomn/admin/log/l536124.req

$ istat /u02/prodcomn/admin/log/l536124.req
Inode 4113965 on device 38/2 File
Protection: rw-r--r--
Owner: 201(oracle) Group: 202(dba)
Link count: 1 Length 2088804 bytes

Last updated: Wed Mar 12 09:41:51 2003
Last modified: Wed Mar 12 09:41:51 2003
Last accessed: Wed Mar 05 04:04:46 2003
 
if i understand you correctly , i think what it is , is the
modification means when the file has been changed ,
access does not necessarily means the file has been modified just viewed , so the 2 are different

say if you have a file and someone made changes to it
but you wanted to know the last time it was accessed and not necessarily modified , the istat output for this is what you would look at.

Does this make sense , or am I barking up the wrong tree
 
I can understand why the access time could be newer than the modification time but not how the modification time could be newer than the access time. Everytime a file is modified it should also be accessed.
 

Well, I just tried touching a file and it changed both the accessed and modified times.

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top