1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-05-20 10:53:23 -07:00
rc/sh/autosync

12 lines
267 B
Bash
Executable File

#!/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
}
autosync "$@"