Rsync (windows < linux)
참고 :
https://www.atlantic.net/community/howto/setup-rsync-daemon/
http://www.joinc.co.kr/w/Site/Tip/Rsync
==========================================================
windows cwRsync 다운로드 :
서버용 :
https://www.backupassist.com/rsync/
클라이언트용 :
https://www.itefix.net/cwrsync
https://www.itefix.net/content/cwrsync-free-edition
==========================================================
윈도우 도스창에서
키생성 : ssh-keygen -t dsa
생성키 해당 서버에전송 : type id_dsa.pub|ssh -p 2200 계정@아이피주소:"type >> .ssh/authroized_keys"
로컬컴퓨터(f:\Downloads)에서 --> 원격서버 저장
rsync -avz 'ssh -p2200' /cygdrive/f/Downloads/ 계정@아이피주소:/var/test/tmp
원격서버 --> 로컬컴퓨터(f:\Downloads)에 저장 :
rsync -avz --rsh='ssh -p2200' 계정@아이피주소:/var/test/tmp /cygdrive/f/Downloads/
eclipse + rsync로 linux 서버 전송
rsync -avz --exclude='Tmp_*' --exclude='*.bak' --exclude='lib_backup' --exclude='cache' --exclude='tmp' --exclude='upload' --exclude='.project' --exclude='.buildpath' --exclude='.git' --exclude='.idea' --exclude='.settings' --exclude='patch.diff' --progress --chmod=Dug=rwx,Dgo=rx,Fu=rw,Fog=r /cygdrive/C/xampp7.0/htdocs/local/ --rsh='ssh -p2200' 계정@아이피주소:/var/test/public_html/
:: 윈도우 ssh 명령어 위치가 다른경우
rsync -avz --exclude='Tmp_*' --exclude='*.bak' --exclude='lib_backup' --exclude='cache' --exclude='tmp' --exclude='upload --exclude='.project' --exclude='.buildpath' --exclude='.git' --exclude='.idea' --exclude='.settings' --exclude='patch.diff' --progress --chmod=Dug=rwx,Dgo=rx,Fu=rw,Fog=r /cygdrive/C/xampp7.0/htdocs/local/ --rsh='D:\win_Rsync\bin\ssh -p2200' 계정@아이피주소:/var/test/public_html/
ps: 둘다 사용가능(포트 직접설정) ==>> --rsh='ssh -p2200' 또는 'ssh -p2200'
####################################
내 노트북에서 linux서버로 전송시
rsync -avz --exclude='Tmp_*' --exclude='*.bak' --exclude='database.conf.php' --exclude='.buildpath' --exclude='.project' --exclude='.settings' --exclude='lib_backup' --exclude='cache' --exclude='tmp' --exclude='upload' --exclude='.project' --exclude='.buildpath' --exclude='.git' --exclude='.idea' --exclude='.settings' --exclude='patch.diff' --progress --chmod=Dug=rwx,Dgo=rx,Fu=rw,Fog=r /cygdrive/D/xampp_php7.0/htdocs/local/ --rsh='ssh -p2200' 계정@아이피주소:/var/test/public_html/
우리집에서 linux서버로 전송시
rsync -avz --exclude='Tmp_*' --exclude='*.bak' --exclude='database.conf.php' --exclude='.buildpath' --exclude='.project' --exclude='.settings' --exclude='lib_backup' --exclude='cache' --exclude='tmp' --exclude='upload' --exclude='.project' --exclude='.buildpath' --exclude='.git' --exclude='.idea' --exclude='.settings' --exclude='patch.diff' --progress --chmod=Dug=rwx,Dgo=rx,Fu=rw,Fog=r /cygdrive/C/xampp7.0/htdocs/local/ --rsh='D:\win_Rsync\bin\ssh -p2200' 계정@아이피주소:/var/test/public_html/
==========================================================
rsync --daemon --config=/etc/rsyncd.conf (서버 환경설정 연결)
/etc/init.d/rsync restart (rsync 재시작)
==========================================================
예제)
rsync -avru /cygdrive/f/downloads/* 계정@아이피주소::계정
rsync -avru /cygdrive/윈도우 폴더경로/* 계정@아이피주소::
==========================================================
/etc/rsyncd.conf 파일내용 참고 (파일없으면 생성)
[계정]
comment = public archive
path = /var/test/tmp
use chroot = no
max connections=10
lock file = /var/lock/rsyncd
# the default for read only is yes...
read only = no
list = yes
uid = nobody
gid = nogroup
# exclude =
# exclude from =
# include =
# include from =
auth users = 계정
secrets file = /etc/rsyncd.secrets
strict modes = yes
# hosts allow =
# hosts deny =
ignore errors = no
ignore nonreadable = yes
transfer logging = no
# log format = %t: host %h (%a) %o %f (%l bytes). Total %b bytes.
timeout = 600
# refuse options = checksum dry-run
# dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz
==========================================================
/etc/rsyncd.secrets 계정 비밀번호 저장파일 (파일없으면 생성)
아이디:비밀번호