hostCrontab.sh 558 Bytes
#!/bin/sh
if [ -x /etc/profile ];then
. /etc/profile
fi
if [ -x ~/.profile ];then
. ~/.profile
fi
if [ -x ~/.bashrc ];then
. ~/.bashrc
fi
if [ -x ~/.bash_profile ];then
. ~/.bash_profile
fi

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

NOTICE_HOME=$AGENT_HOME/notice
SCRIPT_HOME=$AGENT_HOME/script

for i in 1 2 3 4 5 6 7 8 9 10
do
    cd ${SCRIPT_HOME}
    ls ${NOTICE_HOME}/ibm/ | while read line
    do
    nohup sh ${SCRIPT_HOME}/ibm/${line} > /dev/null &

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

    sleep 5
done