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:
Optionally install to your PATH:
Usage
Run rmote from the root of your local directory to start mirroring:
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
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
Examples
-
Default mirror with initial sync:
-
Disable initial full sync:
-
Ignore
.gitandnode_modules: -
Increase debounce to 5 seconds:
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.