Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tomenz/fsnotify

Notify on directory or file actions
https://github.com/tomenz/fsnotify

Last synced: 7 days ago
JSON representation

Notify on directory or file actions

Awesome Lists containing this project

README

        

[![CMake on a single platform](https://github.com/Tomenz/FsNotify/actions/workflows/cmake-single-platform.yml/badge.svg)](https://github.com/Tomenz/FsNotify/actions/workflows/cmake-single-platform.yml)
[![CodeQL](https://github.com/Tomenz/FsNotify/actions/workflows/codeql.yml/badge.svg)](https://github.com/Tomenz/FsNotify/actions/workflows/codeql.yml)
[![Codacy Security Scan](https://github.com/Tomenz/FsNotify/actions/workflows/codacy.yml/badge.svg)](https://github.com/Tomenz/FsNotify/actions/workflows/codacy.yml)

# FsNotify

A linux systemd service to monitors directory's or files, an executes a user defined actions if a event is detected.

# Configuration

The configuration is is done in the fsnotify.cfg file.

```
[/home/user/Downloads]
itemflag=ONLYDIR

monitortyp=CREATE
filter=core.*
limit = 2 / 10s
actiontyp=system
actionpara=ls -l /home/user/Downloads > ./ls.out

monitortyp=DELETE
filter=core.*
actiontyp=system
actionpara=echo Deleted {NOTIFYITEM}/{NAME} >> ./ls2.out

[/home/user/test.sh]
monitortyp=OPEN
filter=.*
actiontyp=system
actionpara=echo OPEN {NOTIFYITEM} >> ./ls2.out

```

monitortyp = ACCESS | ATTRIB | CLOSE_WRITE | CLOSE_NOWRITE | CREATE |
DELETE | DELETE_SELF | MODIFY | MOVE_SELF | MOVED_FROM |
MOVED_TO | OPEN | CLOSE

filter = Regular Expression to filter file or directory name

actiontyp = system | syslog | addmonitor

actionpara = if actiontyp is "system" it can be any shell command or a shell
script (*.sh)

if actiontyp is "addmonitor" the actionpara is a string with a
other monitor configuration.
Example: actionpara = "itemflag=ONLYDIR\nmonitortyp=CLOSE_WRITE\nfilter=^[^\x23]+$\nactiontyp=system\nactionpara=../calcsha.sh {NOTIFYITEM}/{NAME}"