특정 폴더를 서버의 특정 폴더로 동기화함. build.sh로 만들어서 배포용으로 쓰면 편린


#!/bin/sh


rsync -azh ./build -e 'ssh -p 22' user@hostname:~/www

rsync Secure Copy (SCP)


둘의 차이는 뭘까?



두개 다 원격 파일 전송이라는 공통점은 있지만 왜 다르게 쓸까? 

그 이유는 옵션의 차이도 있겠지만 무엇보다 symbolic link 를 처리하는데 차이가 있다. 


scp는 전송하려 하는 파일중에 symbolic link 가 있다면 링크된 원본파일이 전송된다. 

즉, symlink 가 유지 되지 않는다.

rsync 가 뭘까? 알씽크..


웬지 맘에 드는 알 ㅋㅋ


wiki 에 의하면 (http://en.wikipedia.org/wiki/Rsync)


rsync is a utility software and network protocol for Unix-like systems (with a port to Microsoft Windows) that synchronizes files and directories from one location to another while minimizing data transfer by using delta encoding when appropriate. It also has the option to provide encrypted transfer by use of SSH. SSL encrypted transfer can be done via Stunnel wrapping. Quoting the official website: "rsync is a file transfer program for Unix systems. rsync uses the 'rsync algorithm' which provides a very fast method for bringing remote files into sync."[3] A feature of rsync not found in most similar programs/protocols[citation needed] is that the mirroring takes place with only one transmission in each direction, eliminating the message latency overhead inherent in transmitting a large number of small messages.[4] rsync can copy or display directory contents and copy files, optionally using compression and recursion.

For secure transfer, rsync can use SSH to encrypt data during the transfer using the "-e ssh" option. From the man page: "For remote transfers, a modern rsync uses ssh for its communications, but it may have been configured to use a different remote shell by default, such as rsh or remsh."

In daemon mode, rsync listens by default on TCP port 873, serving files in the native rsync protocol (using the "rsync://" syntax). You can also implicitly start it through a remote shell such as RSH or SSH[5] (using the "user@host:[:]" syntax. The "::" mode is not well described and not easy to use). Of course, in both cases you need an rsync client executable installed on the local machine; in the latter case, the client executable acts as a server.

Released under the GNU General Public License version 3, rsync is free software and is widely used.[6][7][8][9]


라고 한다.. 먼말인지 알겠음??


나는머.. 그래서 한글 찾아봄..

http://dev.jpblog.co.kr/21

http://www.joinc.co.kr/modules/moniwiki/wiki.php/Site/Tip/Rsync


위 두곳이 정리가 잘 되어 있음.. 정말 잘되어있다.


끝.

+ Recent posts