반응형

일하다 보면 실제 작업서버와 외부서버간의 데이터를 맞추게 될일이 많다.
근데 이걸 svn 익스포트로 하려니 졸랭 귀찮아..-_-
그래서 배치 파일 하나 만듬

Ex) 1서버 폴더에 있는 작업물을 2서버폴더와 3서버폴더에 동일하게 적용하기

@echo off
TortoiseProc.exe /command:update /path:"C:\1서버폴더\Script" /closeonend:2
TortoiseProc.exe /command:update /path:"C:\2서버폴더\Script" /closeonend:2
TortoiseProc.exe /command:update /path:"C:\3서버폴더\Script" /closeonend:2
xcopy "D:\Server\DesignServer\Script" "C:\2서버폴더\Script" /s /i /y
xcopy "D:\Server\DesignServer\Script" "C:\3서버폴더\Script" /s /i /y
TortoiseProc.exe /command:commit /path:"C:\2서버폴더\Script" /closeonend:2
TortoiseProc.exe /command:commit /path:"C:\3서버폴더\Script" /closeonend:2

흠 근데 이렇게 했더니 승질나게 지워진 파일은 적용이 안되는 문제가 발생
그래서 지우는 명령 추가

@echo off
TortoiseProc.exe /command:update /path:"C:\1서버폴더\Script" /closeonend:2
TortoiseProc.exe /command:update /path:"C:\2서버폴더\Script" /closeonend:2
TortoiseProc.exe /command:update /path:"C:\3서버폴더\Script" /closeonend:2
del /s/q "C:\2서버폴더\Script\*"
del /s/q "C:\3서버폴더\Script\*"
xcopy "D:\Server\DesignServer\Script" "C:\2서버폴더\Script" /s /i /y
xcopy "D:\Server\DesignServer\Script" "C:\3서버폴더\Script" /s /i /y
TortoiseProc.exe /command:commit /path:"C:\2서버폴더\Script" /closeonend:2
TortoiseProc.exe /command:commit /path:"C:\3서버폴더\Script" /closeonend:2


반응형

+ Recent posts