![]() ![]() # systemctl start rvice Linux incrond inotify monitor dir for changes and take action # systemd based Linux distro such as CentOS/RHEL 7.x/8.x, try # Type the following command on a CentOS/RHEL: ![]() ![]() options – It can be any one of the following with command (i.e.– Run command or scripts when mask matched on given directory.The IN_ALL_EVENTS symbol is defined as a bit mask of all of the above events.IN_MOVED_TO – File moved into watched directory.IN_MOVED_FROM – File moved out of watched directory.IN_MOVE_SELF – Watched file/directory was itself moved.IN_DELETE_SELF – Watched file/directory was itself deleted.IN_DELETE – File/directory deleted from watched directory.IN_CREATE – File/directory created in watched directory.IN_CLOSE_NOWRITE – File not opened for writing was closed.IN_CLOSE_WRITE – File opened for writing was closed.IN_ATTRIB – Metadata changed (permissions, timestamps, extended attributes, etc.).Each event can result into command execution. – Mask is is nothing but various file system events such as deleting a file.Any changes made to this path will result into command or action. – It is nothing but path which is an absolute filesystem path such as /home/data.var/named/chroot/var/master IN_CREATE,IN_ATTRIB,IN_MODIFY /sbin/rndc reload var/www/html IN_CREATE /root/scripts/backup.sh /var/spool/incron – This directory is examined by incrond for user table files which is set by users running the incrontab command./etc/ny – This file contains users denied to use incron./etc/incron.allow – This file contains users allowed to use incron.You should put all your config file here as per directory or domain names. /etc/incron.d/ – This directory is examined by incrond for system table files./etc/nf – Main incron configuration file.Type the apt command/ apt-get command under Debian / Ubuntu Linux: Type the following dnf command/ yum command under RHEL / Fedora / CentOS Linux: This page shows how to set up incrond and sync files between two web server nodes. It’s use is generally similar to Linux or Unix cron jobs. 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. inotify brings a comfortable way how to manage files used in your applications. It is a very much great replacement of (obsolete) dnotify. It provides the possibility to monitor various events on files in filesystems. I want to copy (rsync to a remote server) a directory tree whenever file uploaded or deleted in /var/inotify is an inode-based filesystem notification technology. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |