Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] monitoring program



Matt - 

How about the shell command "find"?
It has options for access time ( "-atime" ) and others - Let me paste a bit:

-atime n
    Find files that were accessed n days ago. +n means "find files that were accessed over n days ago" (i.e., not accessed in the last n days). -n means "find files that were accessed less than n days ago" (i.e., accessed in the last n days). See articles 17.5 and 17.7.

-mtime n
    Similar to atime, except that it checks the time the file's contents were modified. See articles 17.5 and 17.7.

-ctime n
    Similar to atime, except that it checks the time the inode (1.22) was last changed. "Changed" means that the file was modified or that one of its attributes (for example, its owner) was changed. See articles 17.5 and 17.7.

-newer file
    Find files that have been modified more recently than the given file. See articles 17.8 and 17.9.

Once you've decided upon your command line, you can then put " >>/var/log/yourlogfile " onto the end to write the output to a log.

The redhat man page lists also the option of "-amin" which is minutes - check your man page for your distro's version for a complete list.

Personally, I like the idea of using "-newer" - that means find files modified after a certain file.  What I would probably try if this were running on a schedule, is to have it find files modified after the log file itself.  (Just be sure the file exists before you run it the first time - "touch /var/log/yourlogfile")
Using a simple shell script you also have the option of printing comments throughout the log file - Could be useful when you are reviewing it - 
Hope this is of some use - 
Jim





It would be a pretty easy shell script to write, I think and quite customizable too. 


On Sun, 17 Feb 2002 21:51:15 +0900
Matt Doughty <mdoughty@example.com> wrote:

> On Sat, Feb 16, 2002 at 03:15:58PM +0900, Pietro Zuco wrote:
> > Hi folks!
> > Are there some program to write a log of all the files access in some lap of
> > time?
> > I just need to know what files are accesss, write or read from one program
> > in a lap of time.
> > 
> > Thankyou in advance :)
> > 
> > Pietro
> 
> Might be a simpler way to do this, but have a look fam:
> http://oss.sgi.com/projects/fam/
> It should provide the functionality you need though it might
> be over kill.
> 
> --Matt
> 
> 


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links