A quick, simple, and swashbuckling tool for synchronizing directories
There's an Arch Linux package on the aur: https://aur.archlinux.org/packages/yarsync/
Otherwise clone this repository and move yarsync
somewhere in your path, or call it directly.
yarsync requires rsync
as well as inotifywait
from inotify-tools
.
Specify src
and dest
directories, and yarsync will keep dest
synchronized with src
until exited. dest
can be a network directory over ssh, like below:
yarsync ship/ [email protected]:~/ &
touch ship/cannon.ball
# cannon.ball now exists in both ship/cannon.ball and [email protected]:~/ship/cannon.ball
# changes to ship/cannon.ball will be mirrored in [email protected]:~/ship/cannon.ball
See yarsync -h
for a list of all options.
-
yarsync --delete src dest
will delete files indest
if they aren't insrc
to keep both sides ship-shape. -
yarsync --exclude=swabbie src dest
will exclude the file/directoryswabbie
from synchronization.--exclude
can be specified multiple times.