7 releases (1 stable)
1.0.0 | Nov 10, 2024 |
---|---|
0.6.0 | Oct 27, 2024 |
0.5.0 | Oct 15, 2024 |
0.4.0 | Oct 13, 2024 |
0.2.1 | Oct 10, 2024 |
#728 in Filesystem
123 downloads per month
26KB
424 lines
WatchCrab
watchcrab
is a Rust-based command-line tool that monitors directories for filesystem events like file creation, modification, and deletion. It triggers shell commands in response to these events, making it ideal for automating file-processing workflows, generating logs, or integrating with larger automation systems.
Project Status
WatchCrab is now fully featured, and the project will be maintained to address any issues or bugs. New features may be added if deemed necessary. If you encounter any problems or have suggestions, please open an issue.
Features
- Directory Monitoring: Monitors directories for events, such as file creation, modification, and deletion.
- Automated Command Execution: Executes customizable shell commands in response to events.
- Asynchronous Event Handling: Optionally handle events asynchronously for higher performance.
- JSON Output: Outputs events in JSON for easier parsing and integration with other tools.
- Graceful Shutdown: Waits for ongoing tasks to complete before termination, preventing data loss.
- Cross-Platform: Compatible with Unix-like systems (Linux, macOS) and Windows.
- Command Logging: Optionally logs stdout and stderr of commands for debugging.
Installation
Binary Installation
- No prerequisites are required to run the binary.
- Go to the releases page and download the latest version for your operating system.
- Extract the .zip file to a directory of your choice.
- Add the binary to your PATH or provide the full path when running the command (or create an alias).
Cargo Installation
Prerequisites:
- Rust (1.81.0 or later)
- Cargo
With Rust and Cargo installed, you can install watchcrab
using the following command:
cargo install watchcrab
Usage
To view all available options, use the --help
flag:
watchcrab --help
For example, for starting to watch a directory for all filesystem events in the current directory recursively:
watchcrab --recursive
To view more usage examples, see the usage examples documentation.
Additional Documentation
You can find the full documentation for watchcrab on crates.io.
Contributing
Contributions are welcome! Please feel free to open issues or submit pull requests on the GitHub repository.
Dependencies
~2–40MB
~607K SLoC