busiCrontab.sh 797 Bytes
#!/bin/sh
if [ -fx /etc/profile ];then
. /etc/profile
fi
if [ -fx ~/.profile ];then
. ~/.profile
fi
if [ -fx ~/.bashrc ];then
. ~/.bashrc
fi
if [ -fx ~/.bash_profile ];then
. ~/.bash_profile
fi

bin=`dirname "$0"`
AGENT_HOME=`cd "$bin/.." ; pwd`

SCRIPT_HOME=$AGENT_HOME/script/busi
TMP_SCRIPT_HOME=$AGENT_HOME/script/busi/busi_tmp
LOG_FILE=$AGENT_HOME/logs/crontab.log

NOTICE_HOME=$AGENT_HOME/notice/bnms

chmod 777 $AGENT_HOME -R

for i in 1 2 3 4 5 6 7 8 9 10
do
CURR_TIME=`date "+%Y-%m-%d %H:%M:%S"`
echo "---------------${CURR_TIME}-----------------------" >> ${LOG_FILE}
for line in $(ls $NOTICE_HOME)
do
echo "exec ${line} ${CURR_TIME}" >> ${LOG_FILE}
nohup sh ${TMP_SCRIPT_HOME}/${line} 1>/dev/null 2>> ${LOG_FILE}  &

# delete notice file
rm -rf ${NOTICE_HOME}/${line}
done

sleep 5
done