- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- finding files older than 1 day
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
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
тАО03-16-2008 04:16 PM
тАО03-16-2008 04:16 PM
I've been trying to find files that are older than 1 day by using the "find -atime +1" command and so far, without any success.
This is what I get :
# ls -ltr
total 27632
-rw-rw---- 1 c11adm sapsys 7078850 Mar 14 22:27 TK20080314221511
-rw-rw---- 1 c11adm sapsys 7067957 Mar 15 22:27 TK20080315221512
# find . -atime +1 -exec ls -ltr {} \;
#
# date
Sun Mar 16 18:56:50 CDT 2008
# whoami
root
#
Based on the current date, I should have both files shown as older than i day.
Am I doing something wrong?
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2008 04:32 PM
тАО03-16-2008 04:32 PM
Re: finding files older than 1 day
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2008 04:42 PM
тАО03-16-2008 04:42 PM
Re: finding files older than 1 day
# find /path -xdev -type f -mtime +1
...will find files that are older than 1-day based upon their last modication time ('mtime'). The '-type f' insures that you are returned only files and not directories, too. The '-xdev' keeps find() from crossing mountpoints. This is very useful when searching the root ('/') directory.
The '-atime' you used specifies the last access timestamp. The '-ctime' specifies the last time the file or directory's inode was changed --- a change in name, permissions, or ownership.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2008 04:45 PM
тАО03-16-2008 04:45 PM
Re: finding files older than 1 day
Thanks for the reply.
Just tried. Still not showing. In fact, I've also tried -ctime and it's also not showing.
The timestamp is on the file is the creation date and after that, I don't think it was ever accessed or modified.
Could that be the reason it's not retrieving as they were neither accessed or modified?
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2008 05:00 PM
тАО03-16-2008 05:00 PM
Re: finding files older than 1 day
Thanks for the reply.
Just tried, no luck.
# ls -ltr
total 27632
-rw-rw---- 1 c11adm sapsys 7078850 Mar 14 22:27 TK20080314221511
-rw-rw---- 1 c11adm sapsys 7067957 Mar 15 22:27 TK20080315221512
#
# find . -xdev -type f -mtime +1
#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2008 08:35 PM
тАО03-16-2008 08:35 PM
Re: finding files older than 1 day
..and what does the following command show:
find . -type f
also,
su adm
find . -xdev -type f -mtime +1
revert
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2008 09:27 PM
тАО03-16-2008 09:27 PM
Re: finding files older than 1 day
for eg:find /usr/bin -atime 1
it will search files under /usr/sbin directory one day ago
find /etc -atime -7 it will search files accessed last 7 days
ok
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2008 07:48 AM
тАО03-17-2008 07:48 AM
Re: finding files older than 1 day
# find . -atime +1 -exec ll -tr {} +
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2008 07:53 AM
тАО03-17-2008 07:53 AM
SolutionIf you use the -atime option you can only do it once. the find command itself modifies the last access time.
-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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2008 06:46 PM
тАО03-17-2008 06:46 PM
Re: finding files older than 1 day
thanks for all your replies...
i think the -atime does indeed change the access timestamp...
regards