ContainerImage.InotifyRsync/init/entrypoint.sh

10 lines
239 B
Bash

#!/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