Fnotify is similar to the linux notify program where it watch directory for change. Beside watching directory for changed, Inotify execute a set of specify action using the action option.
-
Environment
Operating System
: GNU/Linux Ubuntu 18.04
-
Software packages
Packages Version python 3.5+
fnotify
allows you to describe an action to execute whenener a given directory contain has been changed. When running fnotify
for the first time
-
Install using pip
Download the installation script following the below command.
~$ pip install fnotify
Now go ahead and run the below command and wait.
~$ fnotify --help
The below table describe the information needed by fnotify
to work.
Option | Description | Default |
---|---|---|
dir |
The directory to watch | |
action |
Action to perform when the contain of the directory changed | |
-
Watch directory folder with
fnotify
Let us run
fnotify
on a module folder calledmodule_folder
$> fnotify --dir module_folder --action="ls -la"
The above command tell
fnotify
to watch the "module_folder" directory, whenever any file has been changed in that directory and rerun thels -la
shell command.