linux 程序 启动命令

#!/bin/sh

# 获取当前日期
current_date=$(date +%Y-%m-%d)

# 0. 关闭程序
kill -9 `ps -ef|grep java | grep leaf-business-zyyk-flow | awk '{print \$2}'` > /dev/null 2>&1

# 删除创建日期在10天前的日志文件
find ./logs -name "leaf-business-zyyk-flow*.log" -type f -mtime +10 -exec rm -f {} \;

# 启动程序
nohup java -jar leaf-business-zyyk-flow.jar -Dspring.config.location=file:/home/leaf/leaf-business-zyyk-flow/config/application.yml >> ./logs/leaf-business-zyyk-flow-$current_date.log &

posted @ 2025-10-21 10:16  唐怀瑟的世界  阅读(3)  评论(0)    收藏  举报