11 lines
317 B
Bash
11 lines
317 B
Bash
#!/bin/sh
|
|
set -eox pipefail
|
|
|
|
if [ "$RUN_ONCE" = "true" ]; then
|
|
rsync -az --info=progress "$SOURCE_DIR" "$TARGET_DIR"
|
|
else
|
|
cat /proc/sys/fs/inotify/max_user_watches
|
|
while inotifywait -r -e modify,create,delete,move "$SOURCE_DIR"; do
|
|
rsync -az --info=progress "$SOURCE_DIR" "$TARGET_DIR"
|
|
done
|
|
fi |