일정 날짜가 지난 로그파일 삭제
#!/bin/bash
LOG_DIRS=(
"/DATA/LOGS/test1"
"/DATA/LOGS/test2"
)
for target in ${LOG_DIRS[*]}
do
find $target -type f -mtime +365 -exec rm '{}' \;
#find $target -type f -name "server.log*" -mtime +365 -exec rm '{}' \;
done
일정_날짜가_지난_로그파일_삭제
#!/bin/bash
LOG_DIRS=(
"/DATA/LOGS/test1"
"/DATA/LOGS/test2"
)
for target in ${LOG_DIRS[*]}
do
find $target -type f -mtime +365 -exec rm '{}' \;
#find $target -type f -name "server.log*" -mtime +365 -exec rm '{}' \;
done