If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > How to list files modifed within the last 1/2 hour?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-21-04, 14:55
everpro everpro is offline
Registered User
 
Join Date: May 2004
Posts: 12
How to list files modifed within the last 1/2 hour?

Hi all,

I need to find a list of files that have been modifed within the last 30 minutes. This seems like such a simple thing but I am having trouble doing this.

The mtime value on the find command only evaluates by the day, ie.+1 is within the last 24 hours, +2 is within the last 48 hours, etc. I couldn't find and options on the ls command which would work either.

Any help will be greatly appreciated!

Thanks
Reply With Quote
  #2 (permalink)  
Old 07-21-04, 15:12
vgersh99 vgersh99 is offline
Registered User
 
Join Date: Apr 2004
Location: Boston, MA
Posts: 325
man touch - pay attention to the '-t' option
man find - pay attention to the '-newer' option
__________________
vlad
+-----------------------+
| #include <disclaimer.h> |
+-----------------------+
Reply With Quote
  #3 (permalink)  
Old 07-21-04, 15:31
everpro everpro is offline
Registered User
 
Join Date: May 2004
Posts: 12
confused....

I saw that command but that requires you pass it a file as a value to test against. I want to list files up to 30 minutes OLDER than the current time? Any more hints....???
Reply With Quote
  #4 (permalink)  
Old 07-21-04, 15:37
vgersh99 vgersh99 is offline
Registered User
 
Join Date: Apr 2004
Location: Boston, MA
Posts: 325
HINT:
create a file [/tmp/pivot.txt] with 'touch -t <time> /tmp/pivot.txt' where 'time' is 30 minutes BEHIND current time
use 'find -newer /tmp/pivot.txt' to list files created within the 30 mins window from 'current'
__________________
vlad
+-----------------------+
| #include <disclaimer.h> |
+-----------------------+
Reply With Quote
  #5 (permalink)  
Old 07-22-04, 11:03
everpro everpro is offline
Registered User
 
Join Date: May 2004
Posts: 12
hate to be so helpless but..... r/o

I am having a hard time figuring out how to code in a script to create a file (I can do that) and then check the current time (I can do that) but then determine the time for 30 minutes prior to the current time. Any ideas? Thank you so much.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On