2020-11-02 16:22:33 +01:00
2020-11-02 16:22:33 +01:00
2020-11-02 13:46:57 +01:00
2020-11-01 14:55:14 +01:00
2020-11-01 14:55:14 +01:00
2020-11-02 13:46:57 +01:00
2020-11-02 16:22:33 +01:00
2020-11-02 16:22:33 +01:00
2020-11-02 13:46:57 +01:00
2020-11-02 13:46:57 +01:00

pyinotifyd

A daemon to monitore filesystems events with inotify on Linux and execute tasks, which can be Python functions or shell commands. It is build on top of the pyinotify library.

Requirements

Installation

  • Install pyinotifyd with pip.
pip install pyinotifyd
  • Modify /etc/pyinotifyd/config.py according to your needs.

Global configuration

The config file is written in Python syntax. pyinotifyd reads config options from a dictionary named pyinotifyd_config. This is the default configuration:

pyinotifyd_config = {
    # List of watches, description below
    "watches": [],
    # Set the loglevel (see https://docs.python.org/3/library/logging.html#levels)
    "loglevel": logging.INFO,
    # Set the timeout to wait for pending tasks to complete during shutdown
    "shutdown_timeout": 30
}

Watch configuration

A Watch is defined as a dictionary which contains the config options:

{
    "path": "/tmp",
    "rec": True,
    "auto_add": True,
    "event_map": {}
}
Description
Monitoring filesystems events with inotify on Linux and execute tasks
Readme 275 KiB
Languages
Python 92.8%
Shell 7.2%