Vincent Roye
Vincent Roye

Reputation: 2841

Trigger a script when a file is moved in a folder (Linux)

What's the best way to trigger a bash script automatically when a file is moved in a folder ? (I'm working in a Linux environment)

I don't want to use a cron job that checks every minutes my folder.

Upvotes: 1

Views: 977

Answers (1)

Tharanga Abeyseela
Tharanga Abeyseela

Reputation: 3483

Try inotify-tools or fileschanged. These programs can be used to monitor and act upon filesystem events.

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

http://fileschanged.sourceforge.net/

Upvotes: 1

Related Questions