Every script is invoked with just 1 argument, that being the path name
of the file is is supposed to process. Every script returns Zero
(0) to indicate success, and a non-zero value to indicate
failure. Failed files for a script are automatically re-tried up to 5
times.

The file names (test01.sh and test02.sh in the example config file
above) of scripts MUST be unique since they are used to determine the
status of complete files. i.e. You can NOT have 2 scripts with the
exact same file name.

You can move scripts around as long as their file names remain the
same. i.e /home/username/test01.sh can be changed to
/opt/scripts/folder01/folder02/test01.sh, but you may NOT change
it to /home/username/test03.sh. If you do, then all files
associated with this script will be re-tried. There is however a way
around this (if you really MUST rename a file). See the section
Running below.

email is OPTIONAL and if set, an email will be sent to the
specified address every time a script fails to process a given
file. This is detected by checking the return code of the
script. Zero (0) indicates success, and anything else
indicates a failure.

The strings in the files array are regular expressions that are
used to match against file names. If multiple regular expressions
match a single file name for a given script, then that file is
processed just once.

The configuration entry with a key of smtp indicates the SMTP
configuration used to send out email in case of script execution
failures.

You may specify as many --watchdir arguments as the number of
directories you wish to watch.

The --metadatadir is a directory where the metadata about the
completion status of the various scripts on the files being watched is
stored. This is used in the case when the daemon is stopped and
re-started to determine which files have been successfully processed
by a certain script. This is why it is important (nay ESSENTIAL) to
keep the name of the script the same. If you ABSOLUTELY MUST rename a
script, please also rename the folder under this directory to reflect
the new name of the script.

The --config is the path to the configuration file in case it
isn't placed at $HOME/.fsnotifier. Please don't use paths like
~/folder/file since fs-notifier will NOT perform GLOB
expansion.

to monitor the running fs-notifier process (since it blocks). This
ensures that if the process is killed (which it can be by clicking the
Kill Daemon link on the main page), then the process monitoring tool
of your choice will re-start it. This is a valid way by which you can
re-load the configuration file. The process will FAIL to restart if
the configuration file is not in a valid JSON format.

When the fs-notifier process is killed, it sends a SIGTERM
signal to each of the scripts that are currently running, so that
those scripts can handle that signal and [dis]gracefully terminate.