Linux command to "act" on new files in a specific folder?
I want to be able to ftp a file to a specific folder on a server a开发者_如何转开发nd have that server run a script when it detects the new file. Any suggestions?
I tried some stuff with diff and a cron job every minute, but I couldn't quite get the results I wanted.
Any input would be appreciated!
The inotify(7) facilities in Linux provide "let me know me when this changes" functions.
Here is a good intro on how exactly to do it. You'll need a C compiler and some basic programming skills. As msw said, it is based on the iNotify subsystem from the kernel, which enables a timely reaction on modifications to a directory tree.
精彩评论