rmote

Crates.iormote
lib.rsrmote
version0.1.0
created_at2025-08-01 17:29:15.98258+00
updated_at2025-08-01 17:29:15.98258+00
descriptionSimple, fast SFTP directory mirror: local → remote
homepagehttps://github.com/Sheol27/rmote
repositoryhttps://github.com/Sheol27/rmote
max_upload_size
id1777165
size38,735
(Sheol27)

documentation

https://docs.rs/rmote

README

rmote

Simple, fast SFTP directory mirror: local → remote

Description

rmote watches a local directory and mirrors all file and directory changes over SFTP to a remote host. It supports initial full sync, real-time file watching, intelligent event coalescing, and a customizable blacklist of paths to ignore.

Features

  • Initial Sync: Perform a full upload of the local directory tree at startup.
  • Real-Time Watch: Uses filesystem notifications to detect creates, modifications, and deletions.
  • Debounce: Coalesces rapid events within a configurable window.
  • Blacklist: Exclude files or directories by name or path prefix.
  • Preserves Permissions: Remote files and directories inherit the same mode bits as local ones.
  • Recursive Deletes: Automatically removes remote directories when local ones are deleted.

Prerequisites

  • Rust toolchain (1.65+ recommended)
  • SSH key pair configured for passwordless or passphrase-protected authentication
  • Remote host with SFTP enabled

Installation

Install with cargo:

Compile from source with Cargo:

cargo install rmote
git clone https://github.com/yourusername/rmote.git
cd rmote
cargo build --release

Optionally install to your PATH:

cargo install --path .

Usage

Run rmote from the root of your local directory to start mirroring:

rmote --host example.com --user deploy --remote-dir /var/www/my-site

Blacklist

Use --blacklist (or -x) to ignore specific files or directories by exact name or prefix. Paths matching any entry are skipped during sync and watching.

# Ignore files named "secret.json" or the entire "logs" directory
rmote -x secret.json -x logs

Debounce

--debounce-s sets the coalescing window (in seconds) for filesystem events. Higher values group more rapid changes into a single sync operation.

# Wait 3 seconds after the last event before syncing
rmote --debounce-s 3

Examples

  1. Default mirror with initial sync:

    rmote --host example.com --user deploy --remote-dir /srv/app
    
  2. Disable initial full sync:

    rmote --host example.com --user deploy --no-initial-sync
    
  3. Ignore .git and node_modules:

    rmote -x .git -x node_modules
    
  4. Increase debounce to 5 seconds:

    rmote --debounce-s 5
    

Contributing

Contributions, issues, and feature requests are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License. See LICENSE for details.

Commit count: 0

cargo fmt