Linux incrond inotify: Monitor Directories For Changes And Take Action

Written By
Web Webster
Web Webster
Jul 20, 2010

[ Thanks to An Anonymous Reader for
this link. ]

“I want to copy (rsync to remote server) a directory
tree whenever file uploaded or deleted in /var/www/html/upload/
directory under Linux operating systems for backup purpose and/or
load balancing purpose without getting into complex file sharing
setup such as NFS or GFS iscsi storage. How do I monitor
/var/www/html/upload/ and its subdirectory for new files and
executes rsync command to make copy back to
www2.example.com:/var/www/html/upload/?

“inotify is an inode-based filesystem notification technology.
It provides possibility to simply monitor various events on files
in filesystems. It is a very much powerful replacement of
(obsolete) dnotify. inotify brings a comfortable way how to manage
files used in your applications.

“The incrond (inotify cron daemon) is a daemon which monitors
filesystem events (such as add a new file, delete a file and so on)
and executes commands or shell scripts. It’s use is generally
similar to cron.”


Complete Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.