diff options
Diffstat (limited to 'lume-watcher')
-rw-r--r-- | lume-watcher | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lume-watcher b/lume-watcher index 3d299c0..70f1d58 100644 --- a/lume-watcher +++ b/lume-watcher @@ -11,6 +11,7 @@ WATCHED_DIR="/var/www/html/soulmining/src/" COMMAND="/home/haturatu/.deno/bin/deno task lume --dest=site" +OUTPUT_ROOT_DIR="/var/www/html/soulmining" COOLDOWN_TIME=60 LAST_RUN_FILE="/tmp/last_run.time" LOG_FILE="/var/log/lume-watcher.log" @@ -43,7 +44,7 @@ set_last_run_time() { current_time > "$LAST_RUN_FILE" } -# デーモンの開始 +# 監視開始を行う monitor_directory() { inotifywait -m -r -e modify,create,delete "$WATCHED_DIR" | while read -r directory events filename; do echo "$(date): Change detected" >> "$LOG_FILE" @@ -55,6 +56,7 @@ monitor_directory() { sleep 10 cd /var/www/html/soulmining || exit + cd $OUTPUT_ROOT_DIR || exit $COMMAND >> "$LOG_FILE" 2>&1 cd ~ || exit @@ -65,6 +67,7 @@ monitor_directory() { done } +# デーモンの開始 start() { echo "Starting lume-watcher..." monitor_directory & |