6 releases (breaking)
new 0.6.0 | Oct 27, 2024 |
---|---|
0.5.0 | Oct 15, 2024 |
0.4.0 | Oct 13, 2024 |
0.3.0 | Oct 13, 2024 |
0.2.1 | Oct 10, 2024 |
#448 in Filesystem
671 downloads per month
24KB
405 lines
WatchCrab
watchcrab
is a Rust-based command-line tool that monitors directories for filesystem events such as file creation, modification, and deletion. It allows you to execute shell commands when these events occur, making it ideal for automating file processing tasks or generating logs.
Project Status
WatchCrab is currently with the main features implemented but is not stable yet. The project is under active development, and new features and improvements are being added regularly. If you encounter any issues or have suggestions for improvements, please open an issue.
Features
- Directory Monitoring: Observe directories for a wide range of filesystem events, including file creation, modification, deletion, and more.
- Automated Command Execution: Optionally Trigger customizable shell commands automatically in response to detected events.
- Asynchronous Event Handling: Optionally handle events asynchronously to improve performance and responsiveness.
- Optimized for Automation Workflows: Designed to integrate smoothly into automation pipelines with minimal configuration.
- JSON Output: Provides structured JSON output for straightforward parsing and seamless integration with other tools.
- Graceful Shutdown (Unix-like systems): Ensures safe program termination by waiting for all in-progress commands to finish executing before shutting down. This prevents abrupt termination, reducing the risk of data loss or unexpected errors.
- Cross-Platform Compatibility: Runs on both Unix-like systems (Linux, macOS) and Windows.
- Logging of Command Output: Optionally Saves the
stdout
andstderr
of executed commands to a file for easy debugging and record-keeping.
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–9MB
~87K SLoC