开发者

Linux command to "act" on new files in a specific folder?

开发者 https://www.devze.com 2023-01-14 14:26 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消