Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/knbr13/watcher
📁 watch file system events and respond by user-defined commands.
https://github.com/knbr13/watcher
cli events filesystem go golang watcher
Last synced: 11 days ago
JSON representation
📁 watch file system events and respond by user-defined commands.
- Host: GitHub
- URL: https://github.com/knbr13/watcher
- Owner: knbr13
- Created: 2023-05-20T20:15:12.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-11T20:32:18.000Z (9 months ago)
- Last Synced: 2024-06-21T15:35:51.296Z (6 months ago)
- Topics: cli, events, filesystem, go, golang, watcher
- Language: Go
- Homepage:
- Size: 155 KB
- Stars: 25
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Watcher
Watcher is a tool written in Go that monitors file system events and executes specified commands in response to those events.
## Features
- Watch a directory or file for file system events.
- Run custom commands on different types of events (create, write, chmod, remove, rename).
- Optionally watch subdirectories recursively.### Prerequisites
- Go (version 1.13 or later)
### Usage
```bash
./watcher --path "/path/to/watch" --file "/path/to/commands-file-in-yaml-format" -r
```#### Command Line Options:
"-r, --recursive": Watch subdirectories recursively.
"-p, --path": Set the path to the directory to watch for events.
"-f, --file": Set the path to the file that contains the commands to run on each event, check out the `commands.yaml` file to see how this file should look like.