본문 바로가기
Linux

원격호스트에서 ssh 세션을 이용한 rsync 명령으로 파일/디렉토리 복사

by 씨엔아이소프트 2018. 1. 14.
반응형

원격호스트에서 ssh 세션을 이용한 rsync 명령으로 파일/디렉토리 복사 

 

예)

rsync -r -v -u -z --delete -e "ssh -p 22" ~/my_dir john@my_server.net:/home/john/my_backup

 

예)

[root@localhost test]# rsync -v -u -a --delete --rsh=ssh --stats root@172.28.71.45:/home/student1 .

root@172.28.71.45's password: 
receiving file list ... done
student1/
student1/.bash_logout
student1/.bash_profile
student1/.bashrc
student1/test.txt
student1/.mozilla/
student1/.mozilla/extensions/
student1/.mozilla/plugins/
student1/dir/
student1/dir/sub_text.txt

Number of files: 10
Number of files transferred: 5
Total file size: 347 bytes
Total transferred file size: 347 bytes
Literal data: 347 bytes
Matched data: 0 bytes
File list size: 297
File list generation time: 0.002 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 160
Total bytes received: 924

sent 160 bytes  received 924 bytes  309.71 bytes/sec
total size is 347  speedup is 0.32

 

반응형

댓글