zoukankan      html  css  js  c++  java
  • 自动化部署

    1、编写需要执行的shell脚本:
    // 大意:先杀掉进程,再清除日志,再重启jar服务
    echo "重启webSocket" pidlist=`ps -ef |grep SystemCommunication |grep -v "grep"|awk '{print $2}'` kill -9 $pidlist rm $webSocket_home/nohup.out nohup /home/software/jdk1.8.0_221/bin/java -jar /home/SystemCommunication.jar > /home/utry/nohup.out &

    2、设置定时任务:

    crontab -e  // 编辑Linux定时任务配置文件
    
    05 16 * * * /home/webSocketStart.sh
    
    crontab -l  // 查看当前所有的定时任务
    
    05 16 * * * /home/webSocketStart.sh

    3、查看定时任务日志:

    tail -f /var/log/cron
    
    Oct 21 16:02:16 localhost crontab[12132]: (root) END EDIT (root)
    Oct 21 16:02:37 localhost crontab[12166]: (root) LIST (root)
    Oct 21 16:03:01 localhost crond[675]: (root) RELOAD (/var/spool/cron/root)
    Oct 21 16:03:01 localhost CROND[12249]: (root) CMD (/home/utry/webSocketStart.sh)
    Oct 21 16:04:01 localhost crontab[12392]: (root) BEGIN EDIT (root)
    Oct 21 16:04:22 localhost crontab[12392]: (root) REPLACE (root)
    Oct 21 16:04:22 localhost crontab[12392]: (root) END EDIT (root)
    Oct 21 16:05:01 localhost crond[675]: (root) RELOAD (/var/spool/cron/root)
    Oct 21 16:05:01 localhost CROND[12503]: (root) CMD (/home/utry/webSocketStart.sh)
    Oct 21 16:09:44 localhost crontab[12982]: (root) BEGIN EDIT (root)
    Oct 21 16:12:19 localhost crontab[12982]: (root) REPLACE (root)
    Oct 21 16:12:19 localhost crontab[12982]: (root) END EDIT (root)
    Oct 21 16:13:01 localhost crond[675]: (root) RELOAD (/var/spool/cron/root)
    Oct 21 16:14:07 localhost crontab[13419]: (root) BEGIN EDIT (root)
    Oct 21 16:14:38 localhost crontab[13419]: (root) REPLACE (root)
    Oct 21 16:14:38 localhost crontab[13419]: (root) END EDIT (root)
    Oct 21 16:14:41 localhost crontab[13456]: (root) LIST (root)
    Oct 21 16:15:01 localhost crond[675]: (root) RELOAD (/var/spool/cron/root)
  • 相关阅读:
    JS之事件及冒泡
    DOM读取和修改内联样式
    dom查询与修改的一些常用方法
    js修改this指向的三种方法(call,bind,apply)
    JS原型概念
    JS创建对象
    JS的this(谁调用就指向谁)
    变量声明提前与函数声明提前
    JS对象创建
    正则应用之数据采集房屋网站信息
  • 原文地址:https://www.cnblogs.com/dk1024/p/13853002.html
Copyright © 2011-2022 走看看