개발시 사용하는 간단한 소스 업로드 스크립트
PC에 cygwin이 깔려있어서 dos 명령이랑 cygwin 명령이 섞여있다.
@echo off if not exist .tmp mkdir .tmp d:\programs\cygwin\bin\find . -maxdepth 1 -name '*.xml' -newer .lastupload | xargs -I {} cp {} .tmp/ d:\programs\cygwin\bin\find . -maxdepth 1 -name '*.properties' -newer .lastupload | xargs -I {} cp {} .tmp/ scp .tmp/* weblogic@hiratwas:/SYSTEM/wls11g/server_restart/ del .tmp\* /q touch .lastupload
.tmp 디렉토리가 없으면 만든 후
마지막 업로드 시점(=.lastupload파일의 변경시각)이후에 변경된 파일중 *.xml과 *.properties 파일을 .tmp 디렉토리로 옮긴다.
그리고 .tmp 아래의 파일들을 scp를 이용해 업로드
업로드 후 .tmp 아래의 파일들 삭제
다음번 체크를 위해 .lastupload 파일을 touch
find명령은 윈도우 내장 명령과 충돌하기 때문에 cygwin풀 경로를 적어줌
나머지 xargs, cp, touch 등은 $CYGWIN_HOME/bin 이 PATH에 잡혀있음