Files
sanguo_quant_live/management/sanguo_auto_sync/start-watcher.sh
T
2026-03-26 11:00:22 +08:00

28 lines
835 B
Bash
Executable File

#!/bin/bash
# 启动文件监控器 (fswatch 版本)
# ============================================
cd "$(dirname "$0")"
# 检查是否已经运行
if [ -f "watcher.pid" ]; then
PID=$(cat "watcher.pid")
if kill -0 $PID 2>/dev/null; then
echo "✓ File watcher already running with PID $PID"
exit 0
else
echo "✓ PID file found but process not running, starting..."
rm -f "watcher.pid"
fi
fi
# 启动监控器 (fswatch 版本)
nohup ./file-watcher.sh >> "/Users/chufeng/.openclaw/sanguo_projects/sanguo_quant_live/file-watcher.log" 2>&1 &
PID=$!
echo $PID > "watcher.pid"
echo "✓ File watcher (fswatch) started with PID $PID"
echo " Log: /Users/chufeng/.openclaw/sanguo_projects/sanguo_quant_live/file-watcher.log"
echo " To stop: ./management/sanguo_auto_sync/stop-watcher.sh"