Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1038516
  • 博文数量: 239
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 3618
  • 用 户 组: 普通用户
  • 注册时间: 2012-11-12 13:17
文章分类

全部博文(239)

文章存档

2021年(1)

2016年(1)

2015年(30)

2014年(91)

2013年(116)

分类: LINUX

2014-08-04 11:09:18

Synchronization20140616.xml为导出来的xml流水文件。

[root@tam TDI]# cat startTdi.sh

#!/bin/sh

/opt/IBM/TDI/V7.1.1/ibmdisrv -c "/root/TDI/Synchronization20140616.xml" -r Synchronization -l "/root/TDI/sync.log" >/dev/null 2>&1 &



checkTdiServer.sh会监控ibmdisrv进程是否存在,如果不存在先killall掉其子进程,再重启ibmdisrv进程。如果ibmdisrv进程存在,则输出存在信息而不执行其他操作。

[root@tam TDI]# cat checkTdiServer.sh

#=========================================================================

# Purpose:when the server is not running,start it automatic

# Author :123

# History:2014-06-16

# Note   :start TDI when it is down.

# run the script when start OS background

#=========================================================================

#!/bin/sh

while true

do

    ps -ef | grep -v grep | grep ibmdisrv >> /dev/null

    if [ $? -ne "0" ]; then

    echo "the TDI server is not running, now start the server follow"

    killall ibmdisrv

    exec ./startTdi.sh

    else

    echo "the server is still running, we will exit"

    exit 1

    fi

    sleep 2

done

 

 

 

执行命令:表示每5分钟监控一次,如果发现ibmdisrv存在则不执行任何操作,如果发现ibmdisrv不存在,则重启ibmdisrv进程;

#crontab –e

*/5 * * * * /root/TDI/checkTdiServer.sh

阅读(1141) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~