springboot项目启动可通过下面的shell脚本启动。

startup.sh

 app=order-service-rest.jar
appout=logs/${app/.jar/.out}
appoutHisDir=logs/`date "+%Y%m%d"`
if test ! -d 'logs' ; then
mkdir logs
fi
if test ! -f $appout ; then
touch $appout
fi
if test ! -d $appoutHisDir ;then
echo 'mdkir ' $appoutHisDir
mkdir -p $appoutHisDir &&
gzfiles=$(find logs -maxdepth -name *.gz)
if test ${#gzfiles} -ne ;then
mv logs/*.gz $appoutHisDir/
fi
cp logs/*.out $appoutHisDir/ &&
for hisout in $(ls logs/*.out)
do
echo '' > $hisout
done
fi
appPid=`jps -l|grep $app|awk '{print $1}'`
if test ${#appPid} -ne 0 ;then
echo 'stop server ' $appPid '...'
kill -9 $appPid
fi
nohup java -jar $app >> $appout &
tail -0f $appout

启动命令

./startup.sh  order-service-rest.jar

springboot 项目启动脚本的更多相关文章

  1. linux下的springboot项目启动文件

    启动springboot项目的脚本文件,启动时./startup.sh即可,会先关闭原进程,再启一个新进程. 创建startup.sh 写入内容 #!/bin/bash clear echo &quo ...

  2. Springboot 项目启动后执行某些自定义代码

    Springboot 项目启动后执行某些自定义代码 Springboot给我们提供了两种"开机启动"某些方法的方式:ApplicationRunner和CommandLineRun ...

  3. springBoot项目启动类启动无法访问

    springBoot项目启动类启动无法访问. 网上也查了一些资料,我这里总结.下不来虚的,也不废话. 解决办法: 1.若是maven项目,则找到右边Maven Projects --->Plug ...

  4. SpringBoot项目启动时链接数据库很慢

    SpringBoot项目启动时链接数据库很慢 springboot项目在启动时候,如下图所示,链接数据库很慢 解决方法:在mysql 的配置文件中 配置 skip-name-resolve

  5. springboot项目启动成功后执行一段代码的两种方式

    springboot项目启动成功后执行一段代码的两种方式 实现ApplicationRunner接口 package com.lnjecit.lifecycle; import org.springf ...

  6. springboot项目启动之后初始化自定义配置类

    前言 今天在写项目的时候,需要再springboot项目启动之后,加载我自定义的配置类的一些方法,百度了之后特此记录下. 正文 方法有两种: 1. 创建自定义类实现 CommandLineRunner ...

  7. 【log4j】springboot项目启动 ,使用的druid数据源,log4j报错 log4j:WARN Please initialize the log4j system properly.

    springboot项目启动 ,使用的druid数据源,log4j报错 -- :: --- [ restartedMain] o.hibernate.annotations.common.Versio ...

  8. Springboot项目启动不了。也不打印任何日志信息。

    Springboot项目启动不了.也不打印任何日志信息. <!-- 在创建Spring Boot工程时,我们引入了spring-boot-starter,其中包含了spring-boot-sta ...

  9. springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedde

    springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedde 创建 ...

随机推荐

  1. ubuntu16.04编译linux3.9内核

    下载linux内核 解压内核 tar -xvf 安装低版本gcc,不然会报错 apt-cache search gcc-4.7 sudo apt-get install 搜索的名字 设置默认gccsu ...

  2. 源码分析--ConcurrentHashMap与HashTable(JDK1.8)

    ConcurrentHashMap和Hashtable都是线程安全的K-V型容器.本篇从源码入手,简要说明它们两者的实现原理和区别. 与HashMap类似,ConcurrentHashMap底层也是以 ...

  3. 让centos使用ubuntu的make命令补全功能

    一直习惯使用debian.ubuntu做开发机,最近it要求各种安全加固,且只提供centos自动化脚本,而ubuntu版本比较乱,14.16.17都要自己整一遍太麻烦,索性换装centos7. 换了 ...

  4. EAN13条码的校验位的Excel算法

    校验位原公式: 单元格=10-RIGHT(SUM(MID($B3,{1;2;3;4;5;6;7;8;9;10;11;12},1)*{1;3;1;3;1;3;1;3;1;3;1;3})) 简化公式: 单 ...

  5. Nginx学习总结:proxy与rewrite模块(三)

    斜体下划线,表示建议采用默认配置,无需显式的配置 一.ngx_http_upstream_module 此模块中可配置的指令并不是很多.nginx的负载均衡算法包括: 1)round-robin:轮询 ...

  6. Mongodb使用shell实现与javascript的动态交互

    关于利用mongodb的shell执行脚本,这点在以前的文章中有点遗漏:现在在此篇博客中做个补充: 一.在命令行中传入脚本文件 定义一个javasciprt文件,名称为:script1.js,内容如下 ...

  7. No enclosing instance of type TestGson is accessible. Must qualify the allocation with an enclosing instance of type TestGson (e.g. x.new A() where x is an instance of TestGson).

    main方法中实例化内部类报错: public class TestGson { public static void main(String[] args) { Gson gson=new Gson ...

  8. tarzan-linux命令

    1.grep -n 'b' c    查看c中包含‘b’的 行 2. ps -ef  |  grep -n python     ps查看所有进程,并且放到管道中| ,grep 在管道中查找包含pyt ...

  9. webdriver原理

    WebDriver 安装C/S构架设计的: 代码(客户端)--->驱动(解析代码)----->浏览器(服务端) 代码通过http请求发给浏览器驱动,驱动解析代码把他们发给浏览器,浏览器执行 ...

  10. List、Map、Set的存储特点?

    List.Map.Set的存储特点? List:以特定次序来持有元素,可有重复元素 Set:无法拥有重复元素,内部排序 Map:保存key-value值,value可多值