1.start.sh

# start.sh 启动项目
#!/bin/sh
file="/123/springcloud/admin.jar"
if [ -f "$file" ];then
if [ ! -x "$file" ];then
echo "授权执行权限,文件:$file"
chmod a+x $file
fi
echo "开始执行文件:$file"
nohup java -jar $file > //springcloud/admin-log.txt --spring.profiles.active=common,mybatisplus,prd &
else
echo "未找到文件:$file"
fi

3.stop.sh

# 将应用停止
#stop.sh
#!/bin/bash
file="kq-admin.jar"
pid=`ps -ef | grep $file | grep -v grep | awk '{print $2}'`
if [ -n "$pid" ];then
echo "kill $file, pid=$pid"
kill - $pid
else
echo "未找到执行程序:$file"
fi

backup.sh

#back.sh 用于将上次构建的结果备份,然后将新的构建结果移动到合适的位置
#!/bin/bash
# 先判断文件是否存在,如果存在,则备份
file="/lhdata/springcloud/kq/kq-admin.jar"
if [ -f "$file" ];then
cp $file $file.`date +%Y%m%d%H%M%S`
else
echo "未找到文件:$file"
fi

SpringBoot启动和停止脚步的更多相关文章

  1. SpringBoot启动原理分析

    用了差不多两年的SpringBoot了,可以说对SpringBoot已经很熟了,但是仔细一想SpringBoot的启动流程,还是让自己有点懵逼,不得不说是自己工作和学习的失误,所以以此文对Spring ...

  2. springboot 启动的java进程默默终止

    首先说明这是一个灵异事件......... 场景1 :把之前用map实现的缓存用Redis重构,高高兴兴上线更新,10 分钟后,老板告诉我,项目停了,what ??? 像我这么帅气,英俊,聪明的人,更 ...

  3. SpringBoot启动流程分析(二):SpringApplication的run方法

    SpringBoot系列文章简介 SpringBoot源码阅读辅助篇: Spring IoC容器与应用上下文的设计与实现 SpringBoot启动流程源码分析: SpringBoot启动流程分析(一) ...

  4. SpringBoot启动报错Failed to determine a suitable driver class

    SpringBoot启动报错如下 Error starting ApplicationContext. To display the conditions report re-run your app ...

  5. SpringBoot启动方式,Spring Boot 定义系统启动任务

    SpringBoot启动方式,Spring Boot 定义系统启动任务 SpringBoot启动方式 1.1 方法一 1.2 方法二 1.2.1 start.sh 1.2.2 stop.sh 1.2. ...

  6. (五)SpringBoot启动过程的分析-刷新ApplicationContext

    -- 以下内容均基于2.1.8.RELEASE版本 紧接着上一篇[(四)SpringBoot启动过程的分析-预处理ApplicationContext] (https://www.cnblogs.co ...

  7. Springboot 启动分析

    启动类 Spring 启动类主要是 Annotation (@SpringBootApplication) 和 main 方法体中的 SpringApplication.run. 其中注解 @Spri ...

  8. 从SpringBoot启动,阅读源码设计

    目录 一.背景说明 二.SpringBoot工程 三.应用上下文 四.资源加载 五.应用环境 六.Bean对象 七.Tomcat服务 八.事件模型 九.配置加载 十.数据库集成 十一.参考源码 服务启 ...

  9. SpringBoot启动流程源码分析

    前言 SpringBoot项目的启动流程是很多面试官面试中高级Java程序员喜欢问的问题.这个问题的答案涉及到了SpringBoot工程中的源码,也许我们之前看过别的大牛写过的有关SpringBoot ...

随机推荐

  1. linux解决“XXX is not in the sudoers file”错误

    问题:我想在我的Linux系统上使用sudo来运行一些特权命令,然而当我试图这么做时,我却得到了"[我的用户名] is not in the sudoers file. This incid ...

  2. 理解sklearn.feature.text中的CountVectorizer和TfidfVectorizer

    """ 理解sklearn中的CountVectorizer和TfidfVectorizer """ from collections im ...

  3. servlet 中通过response下载文件

    public class ResponseDemo3 extends HttpServlet { private static final long serialVersionUID = -52329 ...

  4. Magento EAV模型

    网址:http://www.ruiwant.com/magento-for-dev-part-7-advanced-orm-entity-attribute-value.html

  5. 通过管理员命令进入D盘

    第一步:Windows键+R打开运行 输入cmd敲回车,打开命令提示符程序.或者点击开始,再点击运行,即可打开命令提示符程序:或者在开始菜单的搜索框中输入CMD:点击运行. 第二步:输入CMD,回车. ...

  6. 【LeetCode-面试算法经典-Java实现】【059-Spiral Matrix II(螺旋矩阵II)】

    [059-Spiral Matrix II(螺旋矩阵II)] [LeetCode-面试算法经典-Java实现][全部题目文件夹索引] 原题 Given an integer n, generate a ...

  7. 还没被玩坏的robobrowser(5)——Beautiful Soup的过滤器

    背景 本节的知识还是属于Beautiful Soup的内容. Beautiful Soup的find和find_all方法非常强大,他们支持下面一些类型的过滤器. 字符串 最简单的过滤器是字符串.在搜 ...

  8. Java Nashorn--Part 2

    在命令行中执行 JavaScript 现在我们有一个 my_script.js 文件,想在 Nashorn 下执行,则需要在命令行下执行该命令: jrunscript my_script.js jru ...

  9. java播放wav文件

    import java.io.File; import java.io.IOException; import javax.sound.sampled.AudioFormat; import java ...

  10. Knockout: 实践CSS绑定和jQuery的blur失去焦点事件, 给未通过校验的输入框添加红色边框突出显示.

    目的: 实践一下Knockout提供的CSS绑定功能和JQuery的blur失去焦点事件, 这次不使用Knockout的afterkeydown事件了. 步骤: 先在htm中添加.error的css样 ...