env_chk.sh

IBM Power 2012. 6. 28. 15:30

#!/usr/bin/ksh
if [ $# -ne 1 ]; then
 echo " Usage: env_chk.sh <log_file> "
 echo "    ex. env_chk.sh env_variables.log "
 exit 1
fi

base_param=${1}
if [ -f ${base_param} ]
   then
        continue
   else
        env >> ${base_param}
        ulimit -a >> ${base_param}
        schedo -aF >> ${base_param}
        vmo -aF >> ${base_param}
        no -aF >> ${base_param}
fi

current_param="${1}_`date +\"%Y%m%d%H%M%S\"`"
env >> ${current_param}
ulimit -a >> ${current_param}
schedo -aF >> ${current_param}
vmo -aF >> ${current_param}
no -aF >> ${current_param}

compare_result=`diff ${base_param} ${current_param} | wc -l`
#echo ${compare_result}
if [[ ${compare_result} -ne 0 ]]
   then
        echo 'parameters are changed... backing up the current variables...'
        echo '#ftp.sh ....           '
        echo 'updating base param....'
        cp ${current_param} ${base_param}
        # exit
   else
        echo 'parameters are not changed... moving to next check'
        # exit
 fi

#echo "removing current param"
rm ${current_param}



블로그 이미지

Melting

,