Skip to content

Watch a folder for changes, and run a command in response

License

Notifications You must be signed in to change notification settings

boksidev/inotify

 
 

Repository files navigation

inotify

This is a Docker container for triggering a command based on changes to a monitored directory. Multiple monitors can be set up for different directories.

Usage

Run

docker create \
    --rm \
    --name inotifyc \
    -v /config/dir/path:/config:rw \
    -v /dir/path:/dir1 \
    $IMAGE
docker start inotifyc

In this case IMAGE is either the tag of an image you built yourself, or the image hosted at ghcr.

Sample configuration

Below is a sample configuration file, which formats Python files with black.

# black.ini
[default]
mode=heap
debug=off
use_polling=no

[events]
command=black $FILE
modified=on
moved=on
created=on
deleted=off
closed=off

[acl]
uid=0
gid=0
umask=0000

[fs]
directory=/dir1
include=*.py
exclude=*.tmp
directory_events=off
check_existence=yes

[time]
debounce=100ms
period=50ms
timeout=5s
requeue=250ms

About

Watch a folder for changes, and run a command in response

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages

  • Python 59.8%
  • Shell 32.3%
  • Dockerfile 7.9%