- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Last access time of doc
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2009 01:29 AM
тАО10-12-2009 01:29 AM
Last access time of doc
Currently I am checking with find command like this; for example that files that havenтАЩt been accessed for at least 50 days
find /mydocs/onlinemanuals -name "*.pdf" -atime +50
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2009 03:21 AM
тАО10-12-2009 03:21 AM
Re: Last access time of doc
ll -u
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2009 03:46 AM
тАО10-12-2009 03:46 AM
Re: Last access time of doc
of course some statistics as how frequently are they using will be better.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2009 05:32 AM
тАО10-12-2009 05:32 AM
Re: Last access time of doc
The file system only keeps one access times, the last one. And it has no access count.
If you need more, then you may have to roll your own, perhaps using a file to remember the last access time (in seconds) and count for a list of interesting files and process any file which was found accessed since the last run of that script.
All the information the file system keeps is available through the STAT function.
For example in PERL you could get the last access times for entries in a list of files in seconds since 1/1/1970 and then print as formatted string using:
perl -lpe 'chomp; $_=localtime((stat)[8])'
Full documentation:
http://perldoc.perl.org/functions/stat.html
fwiw,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2009 11:03 PM
тАО10-12-2009 11:03 PM
Re: Last access time of doc
Which one is trust-able technically :
Unix find .. -atime OR
Perl stat ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2009 11:11 PM
тАО10-12-2009 11:11 PM
Re: Last access time of doc
find / \( -name a.out -o -name '*.o' \) -atime +7
-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.
-mtime n
True if the file modification time subtracted from the initialization 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 in its path operands.
-ctime n
True if the time of last change of file status information subtracted from the initialization 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.
http://docs.hp.com/en/B2355-90689/find.1.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2009 01:22 AM
тАО10-13-2009 01:22 AM
Re: Last access time of doc
"-mtime -2" means files that are less than 2 days old, such as a file that is 0 or 1 days old.
"-mtime +2" means files that are more than 2 days old... {3, 4, 5, ...}
you can read more and wonderful post about this subject from :
http://www.unix.com/tips-tutorials/20526-mtime-ctime-atime.html
Just +10 points for this article :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2009 04:16 AM
тАО10-13-2009 04:16 AM
Re: Last access time of doc
> Which one is trust-able technically : Unix find .. -atime OR Perl stat ?
They both yield the same result since they both use the underlying 'stat()' system call. See the manpages for 'stat(2)'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2009 04:39 AM
тАО10-13-2009 04:39 AM
Re: Last access time of doc
May I say what a pleasure it is to read your responses. They always provide something out of the mainstream, often something I didn't know, they are always on target. And I don't see how you can answer some many questions and continue to maintain such a high standard of excellence.
Thank you, for the many years of your service to the forum.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2009 05:31 AM
тАО10-13-2009 05:31 AM
Re: Last access time of doc
This is probably more accurate than HP's man page.
>Michael: long quote from find(1)
The time measurement details are incorrect. What find(1) doesn't tell you is that is only valid if you are using:
UNIX95=FIDDLE_WITH_FIND_TIMES find ...
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1271016
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1331996
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1329090
http://forums13.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1255440037826+28353475&threadId=1329090