Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/tomenz/fsnotify
- Owner: Tomenz
- Created: 2024-08-26T13:24:57.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2024-08-26T19:06:54.000Z (4 months ago)
- Last Synced: 2024-08-27T16:07:45.611Z (4 months ago)
- Language: C++
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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=ONLYDIRmonitortyp=CREATE
filter=core.*
limit = 2 / 10s
actiontyp=system
actionpara=ls -l /home/user/Downloads > ./ls.outmonitortyp=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 | CLOSEfilter = 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}"