Blog | Tag | Local | Media | Guest | Login  RSS
ftp작업에 해당되는 글 1건
2008.12.03 :: batch 파일 활용
batch 파일 활용

1. IP변경 작업
   다양한 프로그램들도 많지만 간단히 배치파일을 만들어 적용할 수 있다.
   dhcp 설정 파일과 static 설정 파일 두가지 샘플을 작성하였다. 모두 같은 디렉토리에 위치하여야 함!

   dhcp.txt 파일
   ----------------------------------------------------------------
   pushd interface
   reset all
   popd
   pushd interface ip
   set address name="로컬 영역 연결" source=dhcp
   set dns name="로컬 영역 연결" source=dhcp
   popd
   ----------------------------------------------------------------
   dhcp.bat 파일
   ----------------------------------------------------------------
   netsh -f dhcp.txt
   ----------------------------------------------------------------

   static.txt 파일
   ----------------------------------------------------------------
   pushd interface
   reset all
   popd
   pushd interface ip
   set address name="로컬 영역 연결" source=static addr=192.168.0.5 mask=255.255.255.0 gateway=192.168.0.1 gwmetric=1
   set dns name="로컬 영역 연결" source=static addr=168.126.63.1
   popd
   ----------------------------------------------------------------
   static.bat 파일
   ----------------------------------------------------------------
   netsh -f static.txt
   ----------------------------------------------------------------

2. ftp 업로드 작업
   ftp를 이용하여 여러 사이트(같은 계정) 업로드 할 경우 사용
   ftp.bat 파일을 이용해 작업 1.1.1.1 ~ 1.1.1.3 사이트에 파일 올리기! 모두 같은 디렉토리에 위치하여야 함!

   ftp.txt
   ----------------------------------------------------------------
   id
   password
   bin
   hash
   put sourcefile filename
   quit
   ----------------------------------------------------------------
   ftp.bat
   ----------------------------------------------------------------
   ftp -s:ftp.txt 1.1.1.1
   ftp -s:ftp.txt 1.1.1.2
   ftp -s:ftp.txt 1.1.1.3
   ----------------------------------------------------------------
   ※Tip. 수십개 사이트에 작업할 경우 command창에서
      "ftp.bat > ftp.txt" 명령어를 입력하면 결과가 ftp.txt로 저장 된다.
      오류는 command 창에 표시가 되므로 결과만 확인하고 txt파일을 참고하면 된다.