Automatic notification when a file gets modified

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
noguru
Forum Commoner
Posts: 61
Joined: Thu Jun 06, 2002 4:03 am
Location: Just north of the City Of Gold, Land of Milk and Honey

Automatic notification when a file gets modified

Post by noguru »

Hi

I don't know if this is the right forum, but here goes:

How can you "watch" a file on Unix so that everytime the file gets modified, a script runs which does all sorts of stuff, like sending an e-mail notification, etc. to the administrator?

I suppose you can add this to the cron program to check every hour or so if the modified date of this file has changed, but I prefer to be notified immediately.

Thanks
User avatar
llimllib
Moderator
Posts: 466
Joined: Mon Jul 01, 2002 2:19 pm
Location: Baltimore, MD

Post by llimllib »

How about give people access only to a short Python (or perl or ruby or bash, you get the point) script that opens the file for them and sends you an email? that seems like an interesting tack.
Or, use a CVS system? I bet there's functions for that in a CVS system, but I couldn't tell you for sure.
Otherwise, maybe if you have people access the file through sudo it could send you a notification?
never set any of this up myself, just pointing in directions that I'd look (in order of precedence).

Good luck fixing it, find some unix gurus somewhere ;)
Post Reply