The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Find the age of a file in Minutes hari_anj Shell Programming and Scripting 1 03-18-2008 02:22 AM
Find files not accessed on a remote server and delete - Help! bond_bhai Shell Programming and Scripting 1 07-17-2007 02:59 AM
Find files on minutes basis er_aparna Shell Programming and Scripting 3 07-16-2006 06:57 PM
only find files older than x minutes old dsimpg1 Shell Programming and Scripting 1 05-18-2006 08:48 PM
find files onder than 15 minutes sveera UNIX for Advanced & Expert Users 11 08-11-2005 12:48 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-30-2007
Registered User
 

Join Date: Feb 2007
Location: Pune, Dehradun (INDIA), Michigan(US)
Posts: 187
Find accessed file in past 1 or 2 minutes, and throw mail.

Can Anyone tell me how to write the Script to "find file(s) in a directory that is being accessed in last 5 minutes, and if there is result of that find, then throw the mail ".

Means throw the mail to a person regarding whoever and whenever a file is accessed in a directory.

ASAP.
Thnks.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-30-2007
kamitsin's Avatar
Registered User
 

Join Date: Nov 2006
Location: /dev/null
Posts: 174
use find and mailx.

Code:
find . -type f -mmin -2
look at man mailx for more details.

Cheers,
K
Reply With Quote
  #3 (permalink)  
Old 09-12-2007
Registered User
 

Join Date: Feb 2007
Location: Pune, Dehradun (INDIA), Michigan(US)
Posts: 187
Question

MYPATH="/clocal/mqbrkrs/user/mqsiadm/xyz/"
find "$MYPATH" -type f -amin -1 > tempfind.txt

In the above path I want to find the files which has been viewed/opened/touched/modified by any user in past 1 minute.
Viewed/opened/touched means file contents has been opened using more/cat/tail/head etc. commands.

find command that i am using, it shows the name of the file in which i have written the script (Means the script file only).

I have already checked the man find.
Can you guide me on this !!

Thanks !!
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:26 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0