Thursday 8 February 2018

debian - Linux - Watch a folder and run a command when a file exists


On Debian Squeeze, I'd like for ctorrent to automatically open in a screen session if a new torrent file is placed in a particular folder (/home/torrent). Is there an easy way to, in a script, watch for new files being added to a folder and react to this change?



Answer



You should check out inotify-wait, that’s exactly what you need:


https://github.com/rvoicilas/inotify-tools/wiki


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...