log zip 백업

Linux 2012.01.13 14:50 Posted by 애플자라


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
log zip 백업  (0) 2012.01.13
리눅스 세션 계속 유지하기  (0) 2011.09.19
Apache log4j.properties  (0) 2011.08.01
[Linux] Shell프로그램 Crontab으로 실행하기  (0) 2011.04.13
TAG , ,

댓글을 달아 주세요