#events #command #tasks #platform #log #shell #tool

bin+lib watchcrab

WatchCrab is a fast, secure, and easy-to-use Rust-based tool to monitor filesystem events across platforms. Effortlessly automate tasks and log changes.

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

Download history 121/week @ 2024-10-05 394/week @ 2024-10-12 25/week @ 2024-10-19 132/week @ 2024-10-26 7/week @ 2024-11-02 99/week @ 2024-11-09 11/week @ 2024-11-16 2/week @ 2024-11-23 11/week @ 2024-11-30

123 downloads per month

MIT license

26KB
424 lines

WatchCrab

» Crate » Downloads

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

  1. No prerequisites are required to run the binary.
  2. Go to the releases page and download the latest version for your operating system.
  3. Extract the .zip file to a directory of your choice.
  4. 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