Solved

How to get notifed of a new file

Posted on 2011-09-14
2
333 Views
Last Modified: 2012-05-12
Hi Experts,

I want to get a notification when a particular file is created in a particular directory.  I am using Linux.  I don't want to poll.  Is there a way to do it?
0
Comment
Question by:ambuli
2 Comments
 
LVL 53

Accepted Solution

by:
Infinity08 earned 250 total points
ID: 36537414
Have a look at inotify :

        http://en.wikipedia.org/wiki/Inotify

It allows you to do exactly what you need.
0
 
LVL 1

Assisted Solution

by:bitsmakebytzesrun
bitsmakebytzesrun earned 250 total points
ID: 36537451
have you considered doing a file listing/grep in cron?

this will run the check every 10 minutes,  the mail -E flag does not send messages with empty bodies (ie file not found).  you may need to sub /bin, /usr/bin with appropriate local paths or just use ls/mail without path if you have them defined in cron.

crontab -e:

*/10    *       *       *       *       /bin/ls -a | grep "filename" | /usr/bin/mail -Es "1" me@gmail.com
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question