http://www.jb51.net/article/18165.htm
mercredi 7 décembre 2011
mardi 6 décembre 2011
Use script to start/stop/restart a java program
like start tomcat, write a script to start/stop/restart a java program:
script.sh
use: sh script.sh start
Original: http://www.iteye.com/problems/14572
script.sh
use: sh script.sh start
#!/bin/sh
SERVER=/Users/cwang/desktop/test
cd $SERVER
case "$1" in
start)
nohup java -Xmx128m HelloWorld > $SERVER/server.log 2>&1 &
echo $! > $SERVER/server.pid
;;
stop)
kill `cat $SERVER/server.pid`
rm -rf $SERVER/server.pid
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: run.sh {start|stop|restart}"
;;
esac
exit 0
SERVER=/Users/cwang/desktop/test
cd $SERVER
case "$1" in
start)
nohup java -Xmx128m HelloWorld > $SERVER/server.log 2>&1 &
echo $! > $SERVER/server.pid
;;
stop)
kill `cat $SERVER/server.pid`
rm -rf $SERVER/server.pid
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: run.sh {start|stop|restart}"
;;
esac
exit 0
Original: http://www.iteye.com/problems/14572
lundi 5 décembre 2011
mysql 如何判断一个表是否存在
判断一个表是否存在: SHOW TABLES LIKE 'tablename'; 执行这样的sql ,如果返回记录为0则不存在; 创建一个新的表 create table tablename(column1 varchar(10),column2 int)
Inscription à :
Articles (Atom)