sync-rs

Crates.iosync-rs
lib.rssync-rs
version
sourcesrc
created_at2025-02-16 18:06:03.268625+00
updated_at2025-05-14 16:36:05.461394+00
descriptionA CLI tool to sync files between directories
homepage
repositoryhttps://github.com/dest1n1s/sync-rs
max_upload_size
id1558024
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Dest1n1 (dest1n1s)

documentation

README

sync-rs

A simple tool for syncing local directories to remote servers using rsync and SSH.

Features

  • Sync local directories to remote servers using rsync
  • Support for multiple remote configurations per directory
  • Automatic .gitignore filtering
  • Additional ignore patterns support
  • Post-sync command execution
  • Interactive remote shell access
  • Preferred remote selection for automatic use
  • Cache-based configuration management

Installation

cargo install sync-rs

Usage

Basic usage:

sync-rs user@host remote_dir

Command Line Options

  • -o, --override-path: Additional paths to sync (can specify multiple)
  • -c, --post-command: Post-sync command to execute
  • -s, --shell: Open an interactive shell in the remote directory after syncing
  • -n, --name: Name for this remote configuration (used when managing multiple remotes)
  • -l, --list: List all remote configurations for the current directory
  • -r, --remove: Remove a remote configuration by name
  • -d, --delete-override: Enable delete mode for override paths (default: disabled)
  • -P, --preferred: Set this remote as the preferred one for this directory
  • -i, --ignore: Patterns to ignore (can specify multiple)

Examples

  1. Sync to a remote server:
sync-rs user@host remote_dir
  1. Sync with additional paths and post-sync command:
sync-rs user@host remote_dir -o path1 -o path2 -c "npm install"
  1. Open an interactive shell after syncing:
sync-rs user@host remote_dir -s
  1. Create a named remote configuration:
sync-rs user@host remote_dir -n my-remote
  1. List all remote configurations:
sync-rs -l
  1. Remove a remote configuration:
sync-rs -r my-remote
  1. Set a remote as preferred:
sync-rs -n my-remote -P
  1. Sync with additional ignore patterns:
sync-rs user@host remote_dir -i "*.tmp" -i "build/"

Preferred Remotes

When you have multiple remote configurations for a directory, you can set one as preferred:

  1. Set a remote as preferred:
sync-rs -n my-remote -P
  1. List remotes to see which one is preferred:
sync-rs -l

When running sync without specifying a remote, it will automatically use the preferred remote if one exists. If no preferred remote is set, it will prompt you to select one.

Ignore Patterns

By default, sync-rs uses .gitignore to filter files. You can specify additional patterns to ignore:

sync-rs -i "*.tmp" -i "build/" -i "node_modules/"

These patterns will be used alongside .gitignore when filtering files for syncing. The patterns follow rsync's exclude format.

Requirements

  • Unix-like environment (Linux or macOS)
  • rsync
  • SSH

License

MIT

Commit count: 0

cargo fmt