티스토리 뷰

Linux

log zip 백업

애플자라 2012. 1. 13. 14:50
반응형


function fmt_date {
# usage : fmt_date 7 YYYY MM DD
        OFFSET=$((15+24*($1-1))); shift

        for I in $*
        do
                case "$I" in
                "YYYY")
                        printf `TZ=KST+$OFFSET date +%Y`
                        ;;
                "YY")
                        printf `TZ=KST+$OFFSET date +%y`
                        ;;
                "MM")
                        printf `TZ=KST+$OFFSET date +%m`
                        ;;
                "DD")
                        printf `TZ=KST+$OFFSET date +%d`
                        ;;
                "D")
                        printf `TZ=KST+$OFFSET date +"%d/10" | bc`
                        ;;
                *)
                        printf "$I"
                esac
        done
}


for DIR in /APP/ems/ems50/auto/agent_log/ /APP/ems/ems50/auto/content_infos/ /APP/ems/ems50/auto/error/ /APP/ems/ems50/auto/long
_mapping/ /APP/ems/ems50/auto/mqueue/ /APP/ems/ems50/auto/spool/ /APP/ems/ems50/auto/spool_infos/ /APP/ems/ems50/auto/trace/ /AP
P/ems/ems50/auto/drive_check/ /APP/ems/ems50/jupiter/agent_log/ /APP/ems/ems50/jupiter/content_infos/ /APP/ems/ems50/jupiter/spo
ol_infos/ /APP/ems/ems50/jupiter/trace/ /APP/ems/ems50/jupiter/drive_check/ /APP/ems/ems50/market/htdocs/content/ /APP/ems/ems50
/market/htdocs/content_infos/ /APP/ems/ems50/market/htdocs/spool/ /APP/ems/ems50/market/htdocs/spool_infos/ /APP/ems/ems50/FTPRo
ot/backup/ /APP/ems/ems50/FTPRoot/error/ /APP/ems/ems50/auto/log/ /APP/ems/ems50/auto/log_process/ /APP/ems/ems50/auto/report/ /
APP/ems/ems50/jupiter/log/ /APP/ems/ems50/jupiter/log_process/ /APP/ems/ems50/jupiter/spool/ /APP/ems/ems50/FTPRoot/temp/ /APP/e
ms/ems50/FTPRoot/work/
do
        cd $DIR/OLD
        ls -al *.zip > `fmt_date 0 YY MM DD`.lst;
        save -s openbk -b FiveYearV -l full -w '5 year' -y '5 year' *.zip; \rm *zip
done

반응형

'Linux' 카테고리의 다른 글

AIX서버 서버상태확인  (0) 2012.04.20
yum 설치하기  (0) 2012.02.07
리눅스 세션 계속 유지하기  (0) 2011.09.19
Apache log4j.properties  (0) 2011.08.01
[Linux] Shell프로그램 Crontab으로 실행하기  (0) 2011.04.13
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
글 보관함