我的java天地

用shell脚本启动多个java程序

start.sh文件:

#!/bin/bash

CLASSPATH=/root/java/javalib/sms.jar:/root/java/javalib/oracle9.2i.jar:/root/java/javalib/activation.jar:/root/java/javalib/mail.jar:/root/java/javalib/log4j-1.2.8.jar:/root/java/javalib/joda-time-1.0.jar:/root/java/javalib/commons-logging-1.0.4.jar:/root/java/javalib/axis-ant.jar:/root/java/javalib/axis.jar:/root/java/javalib/commons-discovery-0.2.jar:/root/java/javalib/jaxrpc.jar:/root/java/javalib/saaj.jar:/root/java/javalib/ant.jar:/root/java/javalib/xmlsec-1.2.1.jar:/root/java/javalib/wsdl4j-1.5.1.jar:/root/java/javalib/commons-collections-3.1.jar:/root/java/javalib/commons-dbcp-1.2.1.jar:/root/java/javalib/commons-pool-1.2.jar:/root/java/javalib/unittest.jar:/root/java/javalib/asrt.jar:/root/java/javalib/junit.jar
java -cp "$CLASSPATH" cn.com.sendSms > console.log & echo $! > sendSms.pid &

stop.sh文件:

#!/bin/bash

cat sendSms.pid | xargs kill -9



运行sh stop.sh即可
cd   /home/esms/gateway/DBRouter2
sh start.sh
sleep 2

cd   /home/esms/gateway/DBServer2
sh start.sh
sleep 2

posted on 2010-09-01 17:11 tobyxiong 阅读(2885) 评论(0)  编辑  收藏 所属分类: linix


只有注册用户登录后才能发表评论。


网站导航:
 
<2010年9月>
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

导航

统计

常用链接

留言簿(3)

随笔分类(144)

随笔档案(157)

相册

最新随笔

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜