Incron settings for Media Server
wayne@MX5:~$ sudo incrontab -u www-data -l
[sudo] password for wayne:
/data/wip/mmn/insertTVVideos/ IN_MOVED_TO /data/www/bin/scripts/incronWatch.php $@ $@
/data/wip/mmn/insertTVDVD/ IN_MOVED_TO /data/www/bin/scripts/incronWatch.php $@ $@$#
/data/wip/mmn/insertMovieVideo/ IN_MOVED_TO /data/www/bin/scripts/incronWatch.php $@ $@$#
/data/wip/mmn/insertMovieDVD/ IN_MOVED_TO /data/www/bin/scripts/incronWatch.php $@ $@$#
/data/wip/mmn/insertMediaDownloadLinks/ IN_CLOSE_WRITE,IN_NO_LOOP /data/www/bin/scripts/incronWatch.php $@ $@$#
Event Symbols
These basic event mask symbols are defined:
IN_ACCESS | File was accessed (read) * |
IN_ATTRIB | Metadata changed (permissions, timestamps, extended attributes, etc.) * |
IN_CLOSE_WRITE | File opened for writing was closed * |
IN_CLOSE_NOWRITE | File not opened for writing was closed * |
IN_CREATE | File/directory created in watched directory * |
IN_DELETE | File/directory deleted from watched directory * |
IN_DELETE_SELF | Watched file/directory was itself deleted |
IN_MODIFY | File was modified * |
IN_MOVE_SELF | Watched file/directory was itself moved |
IN_MOVED_FROM | File moved out of watched directory * |
IN_MOVED_TO | File moved into watched directory * |
IN_OPEN | File was opened * |
When monitoring a directory, the events marked with an asterisk (*) above can occur for files in the directory, in which case the name field in the returned event data identifies the name of the file within the directory.
The IN_ALL_EVENTS symbol is defined as a bit mask of all of the above events. Two additional convenience symbols are IN_MOVE, which is a combination of IN_MOVED_FROM and IN_MOVED_TO, and IN_CLOSE which combines IN_CLOSE_WRITE and IN_CLOSE_NOWRITE.
The following further symbols can be specified in the mask:
IN_DONT_FOLLOW Don’t dereference pathname if it is a symbolic link
IN_ONESHOT Monitor pathname for only one event
IN_ONLYDIR Only watch pathname if it is a directory
Additionally, there is a symbol which doesn’t appear in the inotify symbol set. It is loopable=true. This symbol disables monitoring events until the current one is completely handled (until its child process exits). Also, there is the symbol recursive=false. This symbol limits the observation on the specified directory and does not include subdirectories. Finally, there is also the symbol dotdirs=true. This symbol will include the hidden directories (where the names starts with a dot) in the observation.
Wildcards
The following wildards may be used inside command specification:
$$ | dollar sign |
$@ | watched filesystem path (see above) |
$# | event-related file name |
$% | event flags (textually) |
$& | event flags (numerically) |
Sources:
Debian Man Page for latest version
Ununtu Man Page: Incrontab
Geeks for Geeks: Incron command in Linux with Examples