重启服务进程 shell脚本
来源:互联网 发布:乐视视频提示网络异常 编辑:程序博客网 时间:2024/05/21 09:29
1 备份 redis-server 数据 shell 脚本
#!/bin/sh
nowTimeS=`date +"%Y-%m-%d-%H:%M:%S"`
echo $nowTimes
nowTimeS=`date +"%Y-%m-%d-%H:%M:%S"`
echo $nowTimes
cp ./dump.rdb ./backpak/dump$nowTimeS.rdb
2 重启游戏服务器 shell 脚本
#!/bin/sh
# Database info
DB_USER="batsing"
DB_PASS="batsingpw"
DB_HOST="localhost"
DB_NAME="timepusher"
# Others vars
REDIS_DIR="/root/" #the mysql bin path
BACK_DIR="/root/backup" #the backup file directory
DATE=`date +%F`
ps -ef|grep -v grep|grep XXGame|while read u p o
#PROCESS=`ps -ef|grep $1|grep -v grep|grep -v PPID|awk 'XXGame'`
do
echo "Kill the process [" $p" ]"
kill -9 $p
done
ps -ef|grep -v grep|grep XXGateway|while read u pp o
#PROCESS=`ps -ef|grep $1|grep -v grep|grep -v PPID|awk 'XXGateway'`
do
echo "Kill the process [" $pp" ]"
kill -9 $pp
done
# Database info
DB_USER="batsing"
DB_PASS="batsingpw"
DB_HOST="localhost"
DB_NAME="timepusher"
# Others vars
REDIS_DIR="/root/" #the mysql bin path
BACK_DIR="/root/backup" #the backup file directory
DATE=`date +%F`
ps -ef|grep -v grep|grep XXGame|while read u p o
#PROCESS=`ps -ef|grep $1|grep -v grep|grep -v PPID|awk 'XXGame'`
do
echo "Kill the process [" $p" ]"
kill -9 $p
done
ps -ef|grep -v grep|grep XXGateway|while read u pp o
#PROCESS=`ps -ef|grep $1|grep -v grep|grep -v PPID|awk 'XXGateway'`
do
echo "Kill the process [" $pp" ]"
kill -9 $pp
done
sleep 2s
cd /usr/server/XXDC/gateway/
nohup ./XXGateway &
cd ../game/
nohup ./XXGame &
cd ../game/
nohup ./XXGame &
//---------------------------------------
windows下文件转换到 linux下, 文件格式转换, 否则 报错。
vi ****.sh
:set fileformat=unix
:wq
//----------------------------------------------------
0 0
- 重启服务进程 shell脚本
- shell脚本:定时重启tomcat服务
- shell脚本强制进程重启
- 用shell脚本重启进程
- linux进程监控重启shell脚本
- SHELL脚本实现服务宕机监控自动重启
- SHell启动服务停止重启脚本模板
- Shell脚本检查memcache进程并自动重启
- linux shell脚本监控进程崩溃自动重启
- shell 实现的自动无限重启脚本,出错自动重启服务
- 使用shell脚本检测weblogic服务,服务返回非200,则自动重启
- shell脚本监控tomcat服务运行状态,服务关闭后进行重启
- shell脚本重启tomcat
- shell 脚本重启tomcat
- shell 重启tomcat 脚本
- tomcat重启shell脚本
- shell 重启tomcat 脚本
- devstack重启服务脚本
- NGUI点击事件传参
- 计算:RenderScript Runtime API参考:简介
- IE9.0或者360下js(JavaScript、jQuery)不能正确执行(加载),按F12后执行正常;Firefox下ajax的success返回数据data(json、string)无法获取
- c# winform 直角坐标系
- 解决LBXScan在ipad上横屏扫码时摄像头旋转90度
- 重启服务进程 shell脚本
- Java中的垃圾回收机制
- java链接ftp服务器
- 为什么说String 是不可变的?
- 函数指针和函数指针数组
- QML中的JavaScript用法详解(一)-----在qml中将字符串类型数据转换为整型数据
- 表空间的属性+修改属性+查询所有表空间名称,状态
- Angular4的输入属性
- SQL索引优化