ContainerImage.InotifyRsync/init/entrypoint.sh

10 lines
239 B
Bash
Raw Normal View History

2020-11-08 19:34:59 +00:00
#!/bin/sh
set -eox pipefail
if [ ! "$RUN_ONCE" -eq "true" ]; then
rsync -avz $SOURCE_DIR $TARGET_DIR
else
while inotifywait -r -e modify,create,delete,move $SOURCE_DIR; do
rsync -avz $SOURCE_DIR $TARGET_DIR
done
fi