linux启动程序和关闭程序脚本
关闭脚本:
#!/bin/bash source /etc/profile log() { echo `date +【%Y-%m-%d" "%H:%M:%S】` $1 } log "kill 168 begain" NAME=importFile168 echo $NAME ID=`ps -ef | grep "$NAME" | grep -v "grep" | awk '{print $2}'` echo $ID echo "---------------" for id in $ID do kill -9 $id echo "killed $id" done log "kill 168 end"
启动脚本:
#!/bin/bash source /etc/profile log() { echo `date +【%Y-%m-%d" "%H:%M:%S】` $1 } log "start 168 begain" nohup /home/data/168/program/jdk1.8.0_111/bin/java -Drun.type=loaddata -ms512m -mx1024m -jar /home/data/168/program/importFile168.jar >> /home/data/168/program/168.log 2>&1 & log "start 168 end"
作者: lost blog
出处: http://www.cnblogs.com/JAYIT/
关于作者:专注服务器端开发
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文链接 如有问题, 可邮件(sawyershaw@qq.com)咨询.