아카이브 로그 삭제 스크립트
DB CAFE
thumb_up 추천메뉴 바로가기
- DBA { Oracle DBA 명령어 > DBA 초급 과정 > DBA 고급 과정 }
- 튜닝 { 오라클 튜닝 목록 }
- 모델링 { 데이터 모델링 가이드 }
#!/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"