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. python+stomp+activemq

    python也可以连接MQ,以ActiveMQ为例,安装stomp.py: https://github.com/jasonrbriggs/stomp.py 下载后安装: python setup.p ...

  2. 我的Maven POM配置

    刚刚把项目从Ant转到Maven,费了好多劲,主要是对Maven边用边学.问题主要集中在项目结构上不太一样,在程序的访问上也有区别,调试和打包等也和原来不太一样.终于折腾完一个可以正常运行的POM配置 ...

  3. java http下载文件/上传文件保存

    private boolean downloadFile(String httpUrl, String savePath) { int byteread = 0; try { URL url = ne ...

  4. jQuery.ajax发送image请求格式

    1\请求端 <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head run ...

  5. struts2 jsp ueditor 上传图片失败,获取不到值,解决方法

    struts2 ueditor 上传图片获取不到值 有点奇怪的是:涂鸦,网络的图片都可以.就是本地上传不行.(应该是struts2过滤了部分本地上传的信息,导致失败) 在进入到imageUp.jsp中 ...

  6. 【转】DSL

    DSL DSL 时不时地会成为一个话题,所以今天想专门说一下. DSL 也就是 Domain Specific Language 的简称,是指为某些特定领域(domain)设计的专用语言.举个例子,L ...

  7. 解决WIN32窗口不响应WM_LBUTTONDBLCLK消息

    原文链接: http://www.cnblogs.com/xukaixiang/archive/2012/05/27/2520059.html 今天在做一个软件时,发现win32创建的窗体不能响应WM ...

  8. Jedis工具类(含分布式锁的调用和释放)

    个人把工具类分为两部分: 一.连接池部分 import org.slf4j.Logger; import org.slf4j.LoggerFactory; import redis.clients.j ...

  9. Linux下查找指定日期的文件

    一.背景 Linux服务器的一个目录里,每天产生海量的文件.为了防止磁盘被写满. 决定每天删除部分老文件.OK,问题来了,如何过滤出指定日期的文件? 二.强大的Linux 一行代码搞定: ls --f ...

  10. ASP.NET 的ClientIDMode属性

    在ASP.NET 4.0之前我们总是要为控件的ClientID头疼,比如明明一个叫lblName的Label放在一个叫做grd的GridView里面后,在页面上改Label的ID就变成了诸如grd_c ...