mirror of
https://github.com/notwa/rc
synced 2024-06-30 19:07:11 -07:00
add autosync util
This commit is contained in:
parent
f1c3609ec1
commit
e76bdf9a32
10
sh/autosync
Normal file
10
sh/autosync
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/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
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user