DEV Community

Cover image for Syncing directories between Linux servers from your phone: visual rsync with live command preview & dry-run
XuTerm
XuTerm

Posted on

Syncing directories between Linux servers from your phone: visual rsync with live command preview & dry-run

Every homelab admin knows this moment: you want to sync a directory between two boxes, and you pause. Was it rsync -av src dst or rsync -av src/ dst? That one trailing slash decides whether you copy the folder into the target or mirror its contents — and combined with --delete, getting it wrong means rsync will happily remove files in your backup directory to "mirror" the wrong source.

I've typed these commands for years and I still pause before hitting Enter. A phone makes it worse: tiny keyboard, easy to fat-finger a path, no comfortable way to double-check before running. So in XuTerm, my Android SSH client, I built a visual rsync panel where the dangerous semantics are made explicit instead of memorized.

Rule 1: never hide the command

The panel is switches on top, but the exact rsync command is always visible at the bottom of the screen, updating live as you toggle options:

rsync -a --info=progress2 ...
Enter fullscreen mode Exit fullscreen mode

No invented shorthand, no hidden -e ssh, no "smart" rewriting. What you see is byte-for-byte what will execute. If you already know rsync, there's nothing to unlearn — the UI is just a flag composer that happens to be touch-friendly.

Rule 2: make the dangerous toggle say what it does

The trailing-slash toggle isn't just labeled --delete. Its description reads:

Sync directory contents (trailing /) — sync the contents of the source dir with --delete; all extra files in the target dir are removed.

One sentence, and you know exactly what will happen to files that exist on the target but not the source. The other options follow the same rule — each toggle maps to one flag, stated plainly:

  • Archive mode (-a), Compress (-z), Keep partial files (--partial)
  • --bwlimit — so a sync doesn't saturate the homelab uplink while someone's streaming
  • --exclude — one pattern per entry

Rule 3: dry-run is one tap, not an afterthought

--dry-run is a first-class toggle, and the recommended workflow is always: dry-run first → check the summary → run for real.

Cross-host sync: the messy homelab reality

Syncing within one host is easy. Syncing across hosts means the app reaches two machines that may be reachable in different ways — one on LAN, one through a public IP. The panel handles this with:

  • Local / Cross-host modes, and for cross-host a Push or Pull choice — run the sync from whichever side both machines can reach
  • Target selection by group — reuse the host groups you already maintain in the app
  • A {host} path variable — expands per target, so a path like srv/app/{host}/data works when every box follows the same layout with a different subfolder

Sync jobs repeat — so templates, not retyping

Backups are the most repetitive task in a homelab. Every sync can be saved as a template (hosts + paths + switches), reloaded in one tap, and re-run a month later without re-reading flags. The monthly "is my backup still working?" check becomes: load template → dry-run → glance at the summary → run.

Try it

The rsync panel ships in XuTerm on Google Play — free, local-first, no account, your SSH keys never leave the device. If there's an rsync flag you'd want as a toggle, the comments are open.

Top comments (0)