sh重启脚本

2021-10-13 17:48:40 浏览数 (1)

代码语言:javascript复制
#!/bin/bash
echo "开始"
echo "`date " %Y-%m-%d %H:%M:%S"` 正在杀进程..."
ps -ef | grep pdd_crawler_price_2.py |awk '{print $2}'|xargs kill -9
echo "`date " %Y-%m-%d %H:%M:%S"` 进程已杀死!"

echo "`date " %Y-%m-%d %H:%M:%S"` 正在重启服务..."
nohup python3 pdd_crawler_price_2.py >/dev/null  2>&1 &
echo "`date " %Y-%m-%d %H:%M:%S"` 服务重启完毕!"

0 人点赞