HP-UX 하위디렉토리 파일리스트를 ls -al 형식으로 보기

2011. 11. 25. 09:5399. 정리전 - IT/13. Unix 얇팍지식


일단 명령어
find /aaa/bbb/ -type f -exec ls -l {} \;

쉘로 만들어 (/aaa/bbb/output.sh)
#!/bin/sh
###############################
##            매일 로그 백업         ##
##        파일(물리) 리스트         ##
################################
NOW=`date +'%Y%m%d%H'`
find /aaa/bbb/ -type f -exec ls -l {} \; > "/aaa/bbb/list_"$NOW".log"
exit 0

클론에 등록하기
# 매일 1시30분마다 실행
30 1 * * * /aaa/bbb/output.sh > /dev/null  2>&1

만들어진 로그파일을 분석하기 클론 만들기(/aaa/bbb/calc.sh)
#!/bin/sh
#############################################################################
#  Name   : BATCH FOR Calc
#  Create : 2011.11.11 by XMan
#  Usage  : ./xxx.sh param1 param2
#############################################################################

#----------------------------------------------------------------------------
#- set parameters
#----------------------------------------------------------------------------
PARAM_1=$1
PARAM_2=$2

#----------------------------------------------------------------------------
#- set configuration
#----------------------------------------------------------------------------
LANG=ko_KR.eucKR
JAVA_HOME=/opt/java1.4
BATCH_HOME=/app/BATCH
BATCH_DEPLOY_HOME=/app/BATCH/deploy
SAPJCO_HOME=/app/sapjco
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin:$BATCH_HOME:$SAPJCO_HOME/lib
SHLIB_PATH=$SHLIB_PATH:$SAPJCO_HOME/lib
CLASSPATH=$CLASSPATH:$SAPJCO_HOME/lib/sapjco.jar

export LANG JAVA_HOME BATCH_HOME PATH SHLIB_PATH CLASSPATH


#----------------------------------------------------------------------------
#- redeploy jar files
#----------------------------------------------------------------------------
rm $BATCH_HOME/lib/file.jar
cp $BATCH_DEPLOY_HOME/file.jar $BATCH_HOME/lib/file.jar


#----------------------------------------------------------------------------
#- set MANIFEST.MF file
#----------------------------------------------------------------------------
jar umf $BATCH_HOME/env/mf/MANIFEST_AL_ATCHFILE.MF $BATCH_HOME/lib/file.jar


#----------------------------------------------------------------------------
#- execute jar file
#----------------------------------------------------------------------------
$JAVA_HOME/bin/java -Xms128m -Xmx256m -jar -Dlaf.home=$BATCH_HOME/env $BATCH_HOME/lib/file.jar $PARAM_1 $PARAM_2