From: PTM on
PTM: Is there any method to see if some file is changed in a directory ?

I'd like build a script, which informs me, when some file in certain
directory has been edited in my server. There is about 500 files, so I
think it is too heavy to make a copy of them and make a file compare.
From: Sylvain Robitaille on
PTM wrote:

> Is there any method to see if some file is changed in a directory ?

There are various ways, including process accounting, rudimentary
methods like examining an ls listing, or more likely taking an md5sum of
the file and comparing to a trusted value.

> I'd like build a script, which informs me, when some file in certain
> directory has been edited in my server. There is about 500 files, so I
> think it is too heavy to make a copy of them and make a file compare.

If you really want to build it, your best bet is likely to base it on
md5sum. If you prefer just to have something that will do that job,
have a look at Aide: http://www.cs.tut.fi/~rammer/aide.html

I hope that helps ...

--
----------------------------------------------------------------------
Sylvain Robitaille syl(a)alcor.concordia.ca

Network and Systems analyst Concordia University
Instructional & Information Technology Montreal, Quebec, Canada
----------------------------------------------------------------------
From: William Hunt on
On Tue, 22 Jan 2008, PTM wrote:

> PTM: Is there any method to see if some file is changed in a directory ?
>
> I'd like build a script, which informs me, when some file in certain
> directory has been edited in my server. There is about 500 files, so I think
> it is too heavy to make a copy of them and make a file compare.

md5sum !

--
William Hunt, Portland Oregon USA
From: Steven J Masta on
PTM wrote:
> PTM: Is there any method to see if some file is changed in a directory ?
>
> I'd like build a script, which informs me, when some file in certain
> directory has been edited in my server. There is about 500 files, so I
> think it is too heavy to make a copy of them and make a file compare.

I haven't used it myself, but you might want to look at fam (File
Alteration Monitor) http://oss.sgi.com/projects/fam/

It's just an API, so you'll have to make your own front end.

Steve
From: Tom N on
On 2008-01-22, PTM <ptmusta(a)utu.fi> wrote:
> PTM: Is there any method to see if some file is changed in a directory ?
>
> I'd like build a script, which informs me, when some file in certain
> directory has been edited in my server. There is about 500 files, so I
> think it is too heavy to make a copy of them and make a file compare.

find has options for that sort of thing. You can do things like:

find /dir -type f -mmin -20 >> /dir/logfile

Find regular files that were modified less than 20 minutes ago in the directory
/dir (and all subdirectories) and record the results in logfile /dir/logfile

There are several other related options. See the TESTS section in the manpage

Tom

--
calhobbit
at gee mail dot com