I have a Linux web server that will have a flash form to process user information. This creates a text file in a directory outside of the public area using the date and time for the filename.

What I need is this, whenever a file is created in that directory the system should send me an email notification. I don't need the contents of the file or the file as an attachment, just a notice.

Seems simple enough but I don't have a clue where to start, any help would really be appreciated.

Recommended Answers

All 6 Replies

why not add that function to the script that creates the actual file?

Yes, I could add that to the form. I thought such a script would be useful for other tasks as well.

a script that watches a directory for changes? too many ways of implementing that

Just one way would do. Any ideas where I could find such a script?

you can write it. simple script to ls /dir/dir >logfile.log in cron to run every once in a while
let the script compare the previous logfile to the one created now. if different - send notification

Sounds good, thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.