tw4452852/barn
:milky_way: A mirror root of your local directory
Barn is a tool to mirror your local directory on a remote machine.
Make sure the remote machine's kernel has enabled CONFIG_FUSE_FS
.
This is the only dependency, no others!
# barn server
By default, it will select a unused port to listen on. Of course you could specify the port with --port
option:
# barn server --port=xxx
# barn client --remote=<remote machine's ip address> --port=<the listenning port>
serving from <ip>:<port>, the mirror root directory: /tmp/barn_xxx
However, you could also find the location through mount point:
# mount
...
/dev/fuse on /tmp/barn_xxx type fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0)
chroot
into that directory:# chroot /tmp/barn_xxx /bin/bash
Have fun!
You could either download the prebuilt binary or build from source.
Zig version: 0.11.0
git clone https://github.com/tw4452852/barn
cd barn
zig build -Dtarget=x86_64-linux-musl
If everything is ok, the binary will be located in ./zig-out/bin/barn
.
This tool is heavily inspired by the u-root's cpu which is an implementation of plan9's cpu. There is an excellant article to talk about it.