Files
ai_wht_B/100start_atlas_wen.sh

37 lines
1.1 KiB
Bash
Raw Permalink Normal View History

2026-01-06 14:18:39 +08:00
#!/bin/bash
# 启动脚本 - start_atlas_wen.sh (强制重启模式)
echo "正在启动 AI 文章生成服务..."
# 检查进程是否已经在运行,如果在运行则先杀死
PID=$(pgrep -f "generate_Atlas_Qianwen_article.py")
if [ ! -z "$PID" ]; then
echo "发现运行中的进程 (PID: $PID),正在停止..."
kill $PID
sleep 1
# 如果进程仍在运行,强制杀死
if pgrep -f "generate_Atlas_Qianwen_article.py" > /dev/null; then
echo "强制终止进程..."
kill -9 $PID
sleep 1
fi
echo "旧进程已停止"
fi
# 启动进程
nohup python3 /home/work/ai_article/generate_Atlas_Qianwen_article.py > /dev/null 2>&1 &
# 等待1秒
sleep 1
# 检查进程是否成功启动
if pgrep -f "generate_Atlas_Qianwen_article.py" > /dev/null; then
echo "✓ AI 文章生成服务启动成功!"
echo "进程ID: $(pgrep -f "generate_Atlas_Qianwen_article.py")"
echo "日志文件: $(pwd)/log10bjh_generate_Atlas_Qianwen"
else
echo "✗ 启动失败,请检查脚本路径和权限"
exit 1
fi