Repository navigation
v0.0.20 — Watch a folder, feed a fleet
v0.0.20 — Watch a folder, feed a fleet
daemon already watched a folder and pushed what appeared in it. It could only
push to one machine, which made it useless for the case it was written for: an
agent on one server producing output for three others.
zapsend daemon --dir ./outbox --to gpu-box,edge-1,edge-2
zapsend daemon --dir ./outbox --to all watching ./outbox (every 2s)
target gpu-box,edge-1,edge-2
after send move to ./outbox/.sent
✓ run-42.tar.zst (1 file(s), 1.2 MB) → gpu-box, edge-1, edge-2 → ./outbox/.sent/run-42.tar.zst
Only "done" when every target has it
A file moves to .sent when all targets acknowledged it. Until then it stays
in the folder, which is the queue: nothing is written anywhere else, and a
restart picks up exactly what is still missing.
The important part is what does not happen. Delivery progress is tracked per
file per target, so a file that reached two of three peers is only sent to
the third on the next tick. Re-sending to the two that already had it would
leave the receiver with report.csv and report (1).csv — duplicates are worse
than a late delivery, because nobody cleans them up.
! again.txt: ghost: connection refused — kept for the next tick
✓ hello.txt (1 file(s), 38 B) → g1, g2 → ./outbox/.sent/hello.txt
A target that fails is named once per file (not once per tick, so a dead peer
does not fill the log), the rest of the fleet still gets the file, and the error
is retried every tick. --pin overrides every target; without it each host uses
the PIN remembered by zapsend trust.
Verified
Windows build on WinPE 10.0.26100.1742 pushing to a Linux receiver on this same
version, two names in one list:
✓ watched.txt (1 file(s), 38 B) → w1, w2 → \\?\C:\out\.sent\watched.txt
--- what is left in the folder
.sent
watched.txt
Both hops landed on the Linux side with identical hashes
(2f0f881f… and 2f0f881f…), and the watched file was gone from the folder
root. Linux suite: 52 fan-out checks — including "one dead target keeps the
file queued, and does not duplicate it on the live one" — plus 15 unit, 31
compat, 28 json, 25 pull-resume, 29 hosts, 19 pull, 17 resume, and the original
single-target daemon walkthrough.
Next
sync DIR --to host is the last piece: send only what the other side does not
have, so re-running it is cheap and a nightly cron is enough.