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. ajax_封装函数_步骤1

    <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8& ...

  2. 【转载】关于Maven项目build时出现No compiler is provided in this environment的处理

    参考地址;https://blog.csdn.net/lslk9898/article/details/73836745

  3. mysql sqlyog提示2058错误或者用Navicat连接本机Docker的Mysql 和一些问题的解决方案

    1. 下载Mysql的Docker镜像: [plain] view plain copy$ docker search mysql (搜索mysql镜像)  $ docker pull mysql ( ...

  4. springboot dubbo logback shutdownhook简单总结

      public class Test { public static void main(String[] args){ System.out.println("1: Main start ...

  5. java api 调用es集群(1.7版本)

    public static void main(String[] args) { Settings settings = ImmutableSettings.settingsBuilder() // ...

  6. python 中的eval()函数,称为评估函数

    目的:使用BDD的时候,feture中传过来的预期结果是列表字符串:assert_list  =  "[1,2,3]",我想要的是[1,2,3] 处理方法:使用eval()评估函数 ...

  7. 10.整合email

    整合email <dependency> <groupId>org.springframework.boot</groupId> <artifactId> ...

  8. 【leetcode】472. Concatenated Words

    题目如下: Given a list of words (without duplicates), please write a program that returns all concatenat ...

  9. mobx学习笔记02——mobx基础语法(class)

    新的语法可能不被浏览器支持,可以使用babel转换为浏览器支持的代码格式: 为什么要定义class? js是一门面向对象的编程语言.需要利用类来复用代码,提高编程效率. 需要什么样的class能力? ...

  10. Linux系统重要文件(二)

    Linux系统重要文件概述 一系统自动挂载文件 文件路径信息:/etc/fstab文件作用说明:实现存储设备自动挂载 [root@centos7 ~]# cat /etc/fstab # # /etc ...