Skip to content

GilbertHan1011/server_sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Server Sync

A terminal UI (TUI) for managing sync tasks, backed by a small local daemon.

  • Create Push tasks (local → remote) or Pull tasks (remote → local)
  • Choose a sync strategy: Mirror, AddOnly, SafeSync, Update
  • Browse local/remote directories inside the TUI
  • View per-task logs
  • Tasks are persisted and restored automatically

Requirements

  • Rust toolchain (edition 2024)
  • rsync available on your machine
  • ssh available on your machine (OpenSSH)
  • For password-based SSH: a working system keyring is recommended (the app stores passwords in the OS keyring when provided)

Install

Build locally:

cargo build --release

Run:

cargo run --release

Usage

The main binary is sync_app (default).

Start the TUI (default)

./target/release/sync_app

Manage the daemon

sync_app start
sync_app status
sync_app stop
sync_app restart

Notes:

  • The TUI will auto-start the daemon if it is not running.
  • The server subcommand is internal.

TUI controls

Dashboard

  • A: Add task (Push)
  • P: Add task (Pull)
  • ↑/↓: Select task (list scrolls)
  • D: Delete selected task
  • R: Dry run selected task
  • S: Restart selected task
  • L: View selected task logs
  • Ctrl+R: Restart daemon
  • Q: Quit

Browsers (local/remote)

  • ↑/↓: Move selection (list scrolls)
  • Enter: Enter directory
  • Space: Select current entry (source/destination depending on flow)
  • N: Create directory
  • Esc: Back/cancel

Where data is stored

All state is kept under your home directory:

  • Daemon socket: ~/.sync_daemon.sock
  • Daemon PID: ~/.sync_daemon.pid
  • Saved tasks: ~/.sync_daemon_tasks.json
  • Saved remote hosts list: ~/.sync_hosts
  • Logs directory: ~/.sync_daemon_logs/
    • Daemon log: ~/.sync_daemon_logs/daemon.log
    • Client log: ~/.sync_daemon_logs/client.log
    • Per-task logs: ~/.sync_daemon_logs/<task_id>.log

Sync modes

  • Mirror: exact copy (uses --delete)
  • AddOnly: add/update only (no delete)
  • SafeSync: mirror, but deleted files are moved to .rsync-backup/ (uses --delete --backup --backup-dir=.rsync-backup)
  • Update: only overwrite if local file is newer (uses --update)

Security notes

  • Remote host input is validated to reduce SSH flag-injection risk.
  • The SSH commands used by the daemon currently include StrictHostKeyChecking=no for non-interactive operation. If you need stricter host key verification, you may want to change this in the server SSH/rsync command builders.

Troubleshooting

  • Nothing happens / can’t connect: check daemon status with sync_app status, and inspect ~/.sync_daemon_logs/daemon.log.
  • UI shows few items: lists support scrolling; use ↑/↓ to move selection and the UI will scroll automatically.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages