#!/bin/bash #mwg@2012-3-31 echo $(pwd)|grep '/home/xmission/jxonline2/gs' > /dev/null && program=SO2GameSvrD echo $(pwd)|grep '/home/kingsoft/server/gameserver' > /dev/null && program=Jx2wzGameSvrD ### num=$(echo $(pwd)|grep -o '.$') gs=${program}_0${num} tim=`date +%Y%m%d_%T` dat=`date +%Y%m%d` ### gstime=$(stat ${program}|grep Modify|awk '{print $2}'|sed s/-//g) diftime=$(date -d "6 days ago" +%Y%m%d) if [ $gstime -lt $diftime ] then ulimit -c unlimited else ulimit -c 512000 fi ## [ -d ./startlog ] || mkdir ./startlog echo ${tim} start ${gs} >> ./startlog/${dat}.log ./${gs} 1> gs.log 2> gs.err & exit 0
转载于:https://blog.51cto.com/wengang/1389737