1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 00:19:02 -08:00
rc/sh/autosync

11 lines
253 B
Text
Raw Normal View History

2017-11-04 06:25:51 -07:00
#!/usr/bin/env zsh
autosync() {
target="$1"
shift
# as a reminder not to get the argument order mixed up:
echo -E "rsyncing to $target" >&2
while inotifywait -q -e create,modify "$@"; do
\rsync -rtl "$@" "$target"
done
}