jenkins配置dump生成每日快照文件

BUILD_ID=pleaseDontKillMe

echo '生成快照文件'

for pid in $(ps -ef|grep /opt/copTomcat|grep -v grep|cut -c 10-15);
do
    echo $pid;
    cd /opt/copTomcat/bin
    echo ‘开始生成文件’;
    jmap -dump:format=b,file=java_pid$pid.hprof $pid
   echo ‘生成文件结束’;
done;

cd /opt/copTomcat/bin
echo '停止tomcat'
./shutdown.sh 

echo '启动tomcat'
./startup.sh 
echo '生成快照文件'

for pid in $(ps -ef|grep /opt/CopTimerTomcat|grep -v grep|cut -c 10-15);
do
    echo $pid;
    cd /opt/CopTimerTomcat/bin
    echo ‘开始生成文件’;
    jmap -dump:format=b,file=java_pid$pid.hprof $pid
   echo ‘生成文件结束’;
   echo ‘生成线程堆栈开始’;
   jstack -l $pid | tee -a jstack$pid.log
   echo ‘生成线程堆栈结束’;
done;

你可能感兴趣的:(jenkins配置dump生成每日快照文件)