auto-sync: 2026-03-26 08:29:43
This commit is contained in:
@@ -3,24 +3,25 @@
|
|||||||
# 启动文件监控器
|
# 启动文件监控器
|
||||||
# ============================================
|
# ============================================
|
||||||
|
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
# 检查是否已经运行
|
# 检查是否已经运行
|
||||||
if [ -f "../watcher.pid" ]; then
|
if [ -f "watcher.pid" ]; then
|
||||||
PID=$(cat "../watcher.pid")
|
PID=$(cat "watcher.pid")
|
||||||
if kill -0 $PID 2>/dev/null; then
|
if kill -0 $PID 2>/dev/null; then
|
||||||
echo "✓ File watcher already running with PID $PID"
|
echo "✓ File watcher already running with PID $PID"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo "✓ PID file found but process not running, starting..."
|
echo "✓ PID file found but process not running, starting..."
|
||||||
rm -f "../watcher.pid"
|
rm -f "watcher.pid"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 启动监控器
|
# 启动监控器
|
||||||
cd "$(dirname "$0")"
|
python3 simple-file-watcher.py > "file-watcher.log" 2>&1 &
|
||||||
python3 simple-file-watcher.py > "../file-watcher.log" 2>&1 &
|
|
||||||
PID=$!
|
PID=$!
|
||||||
echo $PID > "../watcher.pid"
|
echo $PID > "watcher.pid"
|
||||||
|
|
||||||
echo "✓ File watcher started with PID $PID"
|
echo "✓ File watcher started with PID $PID"
|
||||||
echo " Log: $(dirname "$0")/../file-watcher.log"
|
echo " Log: $(dirname "$0")/file-watcher.log"
|
||||||
echo " To stop: ./management/stop-watcher.sh"
|
echo " To stop: ./management/sanguo_auto_sync/stop-watcher.sh"
|
||||||
|
|||||||
Reference in New Issue
Block a user