A fearlessly concurrent filesystem watcher daemon.
Watch for file or directory changes (content, permissions) and execute commands.
Install a Rust toolchain with Cargo.
rustup may help with that.
Install cargo-deb and use the Makefile:
cargo install cargo-deb
make deb
The .deb file will be in the ./releases directory.
Install cargo-rpm and use the Makefile:
cargo install cargo-rpm
make rpm
The .rpm file will be in the ./releases directory.
Build it first, then:
dpkg -i ./releases/watchd....deb
Build it first, then:
rpm -i ./releases/watchd....rpm
The default configuration does a decent job at explaining things; this is just a Markdownification of it.
- Default
config.toml. - Example
config.toml.
Duplicate stdout logs to the specified file.
Default: None
Example:
log-file = "/var/log/watchd.log"Log commands without executing.
Default: false
Example:
dry-run = trueExecute commands on program start.
Default: false
Example:
init = trueIncrement log verbosity.
Default: false
Example:
verbose = trueFile or directory to watch.
Multiple entries allowed.
Path to watch.
- String
- Required
- Must be a valid filesystem path
Watch path and its subdirectories.
- Boolean
- Default:
false
Time between the last received event and the command to execute.
- Float64
- Default:
0.0 - Must be non-negative
List of patterns to ignore.
Syntax: docs.rs.
- []String
- Default:
[] - Must be valid regular expressions
- Backslashes must be escaped
- []String
- Required
- Commands are executed via
$(sh -c "${command}")