I would like to one way synchronise big directory between two machines without direct connection. Either using some cloud storage (without computing power) connected to both machines or an intermediate storage device (like hdd, flash drive, not another machine) that can be connected to machines alternately.
What is important to note is that there is not enough space on intermediate storage for the whole folder, though enough for the biggest file to transfer.
I imagine the flow to be:
- On destination machine: Create snapshot of destination folder and put it on shared storage.
- On source machine: Compare structure of source folder with the snapshot from shared storage and put all missing files with meta information to the shared storage (limited by available space on shared storage).
- On destination machine: Copy files from the shared storage and tell if flow should be repeated.
Is there an already existing solution to do something like this from macOS/Linux shell?
btrfs-send
andbtrfs-receive
can clone a btrfs subvolume to another btrfs filesystem. There is an incremental mode that relies on identical snapshots already present in both filesystems. Data you need to transfer is a bytestream, so you can save it on a flashdrive (possibly after compressing, whatever). This approach won't merge changes but with careful planning (or firm scripting) I think you can propagate changes back and forth. I have never tried this, I don't know how the approach performs, therefore it's not an answer. Start fromman 8 btrfs-send
,man 8 btrfs-receive
.