행위

"아카이브 로그 삭제 스크립트"의 두 판 사이의 차이

DB CAFE

(새 문서: <source lang=sql> #!/bin/bash # 1.아카이브 디렉토리 위치 export ARCH_DIR="/kkckc/archDir" # 1.아카이브 파일 확장자명 export FILE_EXT="arc" count=0 while : do...)
 
 
31번째 줄: 31번째 줄:
 
#echo "COUNT:$count"
 
#echo "COUNT:$count"
 
</source>
 
</source>
 +
[[Category:oracle]]

2019년 12월 19일 (목) 12:32 기준 최신판

thumb_up 추천메뉴 바로가기


#!/bin/bash

# 1.아카이브 디렉토리 위치 
export ARCH_DIR="/kkckc/archDir" 

# 1.아카이브 파일 확장자명 
export FILE_EXT="arc"
count=0

while :
do
FILES=$(ls -lrt $ARCH_DIR/*.$FILE_EXT | awk {'print $9'})
count=0
tcount=0

for file in $FILES; do
        let "count+=1"
done

for file in $FILES; do
                let "tcount+=1"
            if [ "$tcount" -ne "$count" ]
                        then
                                echo "DELETE $file"
                                rm -rf $file
                fi
done
sleep 10
done
#echo "COUNT:$count"