Last updated: 2026-07-08
You have a large folder — tens of gigabytes — on one server and you want an exact copy on another. You can't watch a terminal for hours, and a transfer that dies halfway shouldn't start over from zero. relayium sync is built for this: a one-way incremental mirror that skips what's already there, resumes a half-sent file from where it stopped, and verifies every file end to end.
This guide sets up an unattended, self-healing transfer: authorize the sender once, run the listener in the background, and drive relayium sync from a retry loop inside tmux so it keeps going across dropped connections until the whole folder has landed.
sync is a one-way incremental mirror over the native protocol (install relayium on both ends). Three properties make it safe to run and re-run unattended:
Install relayium on both servers (sync speaks the native protocol, so it must be present on each end):
# on BOTH servers
curl -fsSL https://relayium.com/install.sh | sh
The receiver approves the sending machine one time; the approval is written to disk and stays valid across restarts, so you never repeat it. Start the listener in a terminal, and point --dir at the parent directory — relayium sync /root/workspace reproduces workspace/... on the receiver, so --dir /root lands the files at /root/workspace/.
On the sender's first connection (next section), serve shows its address and fingerprint and asks you to approve it; answer y and it's remembered for good:
# on the RECEIVER (foreground, to approve interactively)
relayium serve --dir /root --port 9031
# on the RECEIVER, at the first connection:
Incoming push from 203.0.113.9:52140
fingerprint: 9f2c41ab…
Accept and remember this peer? [y/N] y
Once the fingerprint is authorized, stop the foreground serve (Ctrl-C) and re-launch it detached so it survives your logout. It loads the saved fingerprint and accepts the sender silently — no prompt this time:
# on the RECEIVER
nohup relayium serve --dir /root --port 9031 > ~/relayium-serve.log 2>&1 &
Long transfers get interrupted — a dropped session, a flaky network, a reboot. The fix isn't a fancy tool; it's a loop that reruns sync until it succeeds, plus a terminal multiplexer so it survives you logging out. tmux is cleaner than nohup here: no output redirection to get wrong, and you can reattach to watch progress.
Start a tmux session, then run the mirror in an until loop — it retries every 10 seconds until sync returns success, then exits on its own:
# on the SENDER
tmux new -s xfer # apt install -y tmux if it's missing
until relayium sync /root/workspace relayium://203.0.113.43:9031; do echo "$(date) retrying"; sleep 10; done
The transfer is complete when the until loop ends and you're back at a normal shell prompt. Confirm both sides match, then stop the listener:
# compare totals on BOTH servers
du -sh /root/workspace
# on the RECEIVER, once verified
pkill -f 'relayium serve'
A few things that look like problems but usually aren't — and the one that usually is (a blocked port).
Nothing is lost. Rerun relayium sync — it skips files already on the receiver and resumes a half-sent file from the byte offset already on disk. The until loop in this guide does that automatically until the whole folder is mirrored.
Both do incremental one-way mirroring, but relayium sync runs over a pinned TLS connection with no SSH account required (daemon direct), authenticates the two machines by certificate fingerprint, and verifies every file with SHA-256. It's the same transfer engine as relayium's other modes.
Only if you ask. By default sync only adds and updates. Pass --delete to mirror deletions, and the receiver must run serve with --allow-delete for it to be honored — otherwise the delete is ignored and reported back.
Yes. Add --watch and sync stays running, re-mirroring on any change under the source. For a one-time move of a large folder you don't need it — the retry loop plus a plain sync is enough.
For daemon direct, yes — the listener's port (9031 by default) must be reachable from the sender. If you'd rather not open a port and already have SSH between the servers, sync also works over SSH: relayium sync /path user@host:/path (relayium must be installed on the remote).
Mirror a folder between two of your own servers — incremental, resumable, no babysitting.
Get the CLI