发表于: 2018-01-25 20:50:26
2 576
师兄说这个日志打印很重要,后面面试的时候非常有用---->今天重新弄一下日志打印时间的获取
http://download.csdn.net/download/xunzaosiyecao/9607043(参考的文档)
今天弄了一天,代码改了几个版本,还是不能打印日志--->明天再继续
今天先学一点其他的怎么编写shell脚本语言
最近看知乎 有篇文字推荐一个APP -->guide to linux
界面是这个样子---->
因为那个Nginx的脚本最开始出现问题 有没有办法解决
还是先了解一下怎么编写脚本
这个里面开始是讲简单的输入输出(shell script)
1. echo------>输出的
例如: 输出 hello world
#!/bin/bash
#my first script
echo "hello world"
运行 输出的就是 hello world
就是怎么赋值的操作,可以用$+赋值的名字展示里面的内容
例如:myvar2.sh
#!/bin/sh
echo "MYVAR is: $MYVAR"
MYVAR="hi there"
echo "MYVAR is: $MYVAR"
Now run the script:(运行)
$ ./myvar2.sh
MYVAR is:
MYVAR is: hi there
1. read 读取输入的字段内容
#! /bin/bash
echo "Hey what's Your First Name?";
read a;
echo "welcome Mr./Mrs. $a, would you like to tell us, Your Last Name";
read b; echo "Thanks Mr./Mrs. $a $b for telling us your name";
echo "*******************"
echo "Mr./Mrs. $b, it's time to say you good bye"
Sample Output
Hey what's Your First Name?
John
welcome Mr./Mrs. John, would you like to tell us, Your Last Name
Smith
Thanks Mr./Mrs. John Smith for telling us your name ******************************************************
Mr./Mrs. Smith, it's time to say you good bye
简单的了解了脚本语言
准备开始编写启动的脚本语言
#! /bin/bash
svn up
#maven打包跳过test的测试
mvn -U clean install -Dmaven.test.skip=ture
#关闭tomcat
/usr/tomcat7/apache-tomcat-8.5.24/bin/shutdown.sh
#移除 以前的ssm
rm -rf /usr/tomcat7/apache-tomcat-8.5.24/webapps/ssm.war&ssm
#复制新的ssmde war包到webapps下面
cp /home/gitrepos/ssm/ssm.war /usr/tomcat7/apache-tomcat-8.5.24/webapps/
#重启tomcat
/usr/tomcat7/apache-tomcat-8.5.24/bin/startup.sh
接下来就是给权限
就是可执行文件
今天完成的事情:开始准备日志,换了几个版本,还是不行,后面可能一些地方没有对,明天再来,一定搞定它
明天的事情:继续坚持Aop注解在ssm和controller的日志打印
今天的困难:还是AOP的切面不对,总是出问题,坚持快了,我感觉要成功啦(要崩溃,先坚持)
评论