当前位置: 首页 > news >正文

wordpress 送女友嘉定区整站seo十大排名

wordpress 送女友,嘉定区整站seo十大排名,制作网页网站,什么网站可以做相册1、脚本简介 tomcat看门狗#xff0c;在tomcat进程异常退出时会自动拉起tomcat进程并记录tomcat运行的日志。 1 函数说明#xff1a; 2 log_info#xff1a;打印日志的函数#xff0c;入参为需要在日志中打印的msg 3 start_tom#xff1a;启动tomcat的函数…1、脚本简介   tomcat看门狗在tomcat进程异常退出时会自动拉起tomcat进程并记录tomcat运行的日志。 1 函数说明 2 log_info打印日志的函数入参为需要在日志中打印的msg 3 start_tom启动tomcat的函数 4 check_tom_run:每隔30s检测tomcat进程是否存在 5 log_backup:备份tomcat监控日志 check_tom_run每隔30s检测tomcat进程是否存在log_info用于记录tomcat运行日志和操作日志。tomcat进程不存在时执行start_tom去启动。当日志文件大小大于指定大小时则备份监控日志。2、前提条件   a、需要一台Linux主机   b、主机上已部署tomcat   访问地址http://localhost:8080/ 如果出现以下界面则说明tomcat已成功启动。      3、脚本代码   脚本代码如下 1 #!/bin/bash2 #以下为多行注释3 : !4 作用tomcat watch dog用于在tomcat进程退出后自动拉起tomcat5 函数说明6 log_info打印日志的函数入参为需要在日志中打印的msg7 start_tom启动tomcat的函数8 check_tom_run:每隔10s检测tomcat进程是否存在9 log_backup:备份tomcat监控日志10 !11 12 curr_pathpwd13 #tomcat的安装路径14 tom_path/home/stephen/InstallPath/apache-tomcat-8.5.3915 16 17 #定义打印日志的函数18 function log_info(){19 local curr_timedate %Y-%m-%d %H:%M:%S20 log_file${curr_path}/tom_running.log21 #判断日志文件是否存在22 if [ -e ${log_file} ]23 then24 #检测文件是否可写25 if [ -w ${log_file} ]26 then27 #若文件无写权限则使用chmod命令赋予权限28 chmod 770 ${log_file}29 fi30 else31 #若日志文件不存在则创建32 touch ${log_file}33 fi34 #写日志35 local info$136 echo ${curr_time} whoami [Info] ${info}${log_file}37 }38 39 function start_tom(){40 log_info Begin to start tomcat.41 cd ${tom_path}/bin42 log_info cd ${tom_path}/bin43 sh startup.sh44 log_info sh startup.sh45 #使用ps命令awk获取tomcat的PID46 tom_pidps -aux|grep apache-tomcat|grep -v grep|awk {print $2}47 if [ -z ${tom_pid} ]48 then49 sh startup.sh50 fi51 log_info End to start tomcat.52 }53 54 #如果tomcat_pid为零则说明tomcat进程不存在需要去重启55 function check_tom_run()56 {57 tom_pidps -aux|grep apache-tomcat|grep -v grep|awk {print $2}58 echo ${tom_pid}59 if [ -z ${tom_pid} ]60 then61 echo tomcat process is not running.62 #调用函数start_tom63 start_tom64 log_info tomcat process is not running.65 #打印日志66 else67 echo tomcat process is running68 #打印日志69 log_info tomcat process is running70 fi71 }72 #备份日志73 function log_backup(){74 cd ${curr_path}75 log_nametom_running.log76 #获取当前日志的大小77 log_sizels -all|grep -v ${log_name}.|grep ${log_name}|awk {print $5}78 echo ${log_size}79 #当日志大于150MB时进行备份并清空旧的日志80 expect_sizeexpr 150 \* 1024 \* 102481 echo ${expect_size}82 if [ ${log_size} -gt ${expect_size} ]83 then84 log_info Begin to backup log.85 local ctdate %Y-%m-%d-%H-%M-%S86 cp ${log_name} ${log_name}.${ct}87 log_info cp ${log_name} ${log_name}.${ct}88 #使用gzip命令压缩日志89 gzip -q ${log_name}.${ct} ${log_name}.${ct}.gz90 #清空旧日志91 cat /dev/null ${log_name}92 log_info cat /dev/null ${log_name}93 fi94 }95 96 #隔30s循环执行check_tom_1run97 while [ 1 ]98 do99 check_tom_run 100 log_backup 101 #休眠30s 102 sleep 30 103 done View Code   4、运行结果   4.1、运行脚本命令如下 1 chmod x /tomcatWatchDog.sh #表示脚本后台运行2 ./tomcatWatchDog.sh   4.2、新打开一个窗口杀掉tomcat进程 #获取tomcat的PID ps -ef|grep tomcat #kill进程PID为tomcat进程ID kill -9 PID   4.3、查看tom_running文件从日志来看tomcat进程已自动拉起。 1 2019-04-04 15:23:19 stephen [Info] tomcat process is running2 2019-04-04 15:23:20 stephen [Info] tomcat process is running3 2019-04-04 15:23:34 stephen [Info] tomcat process is running4 2019-04-04 15:24:04 stephen [Info] tomcat process is running5 2019-04-04 15:24:34 stephen [Info] Begin to start tomcat.6 2019-04-04 15:24:34 stephen [Info] cd /home/stephen/InstallPath/apache-tomcat-8.5.39/bin7 2019-04-04 15:24:34 stephen [Info] sh startup.sh8 2019-04-04 15:24:34 stephen [Info] End to start tomcat.9 2019-04-04 15:24:34 stephen [Info] tomcat process is not running. 10 2019-04-04 15:25:04 stephen [Info] tomcat process is running 11 2019-04-04 15:25:34 stephen [Info] tomcat process is running   4.4、当日志文件大小大于指定大小时会备份日志文件。 1 -rwxr-xr-x 1 stephen stephen 2679 4月 4 14:57 tomcatWatchDog.sh* 2 -rwxrwx--- 1 stephen stephen 573893 4月 4 15:28 tom_running.log* 3 -rwxr-x--- 1 stephen stephen 7597 4月 4 12:43 tom_running.log.2019-04-04-12-43-53.g  转载于:https://www.cnblogs.com/webDepOfQWS/p/10655022.html
http://www.yutouwan.com/news/380073/

相关文章:

  • 信息技术网站建设专业网站运营模式
  • 网站建设合同书范本网红营销的劣势
  • 龙岗网站建设公司网络服务如何做代刷网站长
  • 阜阳学网站建设网站项目建设的组织机构
  • wordPress主题模板站ui设计网上培训课程
  • 做网站的ui框架网站活动策划方案
  • dtcms网站开发教程制作一个网站的成本
  • 嘉定网站建设哪家好app是网站吗
  • 中国建设银行对公网站首页海安网站建设
  • 宝塔批量建站工具公司怎么建立网站吗
  • 旅行社网站建设规划方案做外贸哪个网站要办信用卡的
  • 网站开发硬件成本河北建设局网站首页
  • 中国林业建设工程网站做企业网站什么软件好
  • 公司手机版网站学校网站开发必要性与意义
  • 建设网站多少钱 郑州最好网页设计培训
  • 接网站建设单子的网站网站建设与维护 许宝良
  • 建立网站有哪些步骤?最好免费高清视频在线观看
  • 做长老环的网站女教师遭网课入侵直播
  • 北仑网站网页建设域名服务器上存放着internet主机的
  • 天津宇昊建设集团有限公司网站北京到安阳的火车票时刻表查询
  • 学校做网站的目的ftp地址格式怎么写
  • 建设银行余额查询网站设计师网站推荐家装
  • 建立简单的网站网站开发分为哪几块
  • 网站制作基本规则互联网网络推广
  • html制作企业宣传网站jf厂高仿手表网站
  • 重庆建设工程公司网站公司网站建设属于软件销售
  • 直播软件下载网站数字博物馆网站建设内容
  • 网站设计 西安网站页面管理
  • app网站开发哪里有seo搜索优化公司排名
  • 公司官方网站建设网站建设规划书模板