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

RE: program to monitor directory changes (new files) and send e-mail



Dunno...looks pretty intense to this noob.  :)

Seriously though, if I'm following what you're doing (and I think I am), that should do it.  I'd just have to set the cron job to run fairly frequently.  Amazingly, I already have one running that strips out .xml files that fires every minute (yikes!)...I could just add your bit-o-magic to that.

Thanks!

Stuart
 

-----Original Message-----
From: Anthony E. Greene [mailto:agreene pobox com]
Sent: Thursday, March 13, 2003 9:33 AM
To: redhat-list redhat com
Subject: Re: program to monitor directory changes (new files) and send
e-mail


On 13-Mar-2003/08:55 -0500, "Douglas, Stuart" <stuart douglas agt com> wrote:
>I was hoping to find a way to do this directly via an ftp daemon, but it
>looks like I'll need an external program.  I want to find a way to have
>my ftp server watch a specific directory for any new file uploads and
>send an e-mail to a specified account when any occur.  Anyone have any
>ideas on how this might best be done?

What about a cronjob that does this:

olddirsum=`cat olddirsum`
newdirsum=`ls --full-time /ftpdir | md5sum`
if [ "$newdirsum" != "$olddirsum" ]; then
  ls /dir | mail -s 'Updated FTP Directory' my myaddress
  echo "$newdirsum" > olddirsum
fi


Tony
-- 
Anthony E. Greene <mailto:Anthony%20E %20Greene%20%3Cagreene pobox com%3E>
OpenPGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26  C484 A42A 60DD 6C94 239D
AOL/Yahoo Messenger: TonyG05    HomePage: <http://www.pobox.com/~agreene/>
Linux. The choice of a GNU generation <http://www.linux.org/>



-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request redhat com?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list





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