1. rsync ¼³Ä¡
´ç¿¬È÷ rsync°¡ ¼³Ä¡µÇ¾î ÀÖ¾î¾ß ÇÑ´Ù.
2. ÀϹÝÀûÀÎ »ç¿ë
rsync -avz -e "ssh -p 22" ip.sh testuser@192.168.1.10:/test/
password: ¶ó¸é¼ Æнº¿öµå¸¦ ¹°¾îº¸°Ô µÈ´Ù.
3. expect È°¿ë
expect <<EOF
spawn rsync -avz -e "ssh -p 22" ip.sh testuser@192.168.1.10:/test/
expect "password:"
send "passpass\r"
expect eof
EOF
- °á°ú
# rsync_test.sh
spawn rsync -avz -e ssh -p 22 ip.sh testuser@192.168.1.10:/test/
testuser@192.168.1.10's password:
sending incremental file list
testfile.txt
sent 224 bytes received 31 bytes 510.00 bytes/sec
total size is 213 speedup is 0.84
4. ¿À·ù
"ssh -p 22" ¸¦ 'ssh -p 22' ¿Í °°ÀÌ Single QuotationÀ¸·Î »ç¿ëÇÏ¸é ¿À·ù ¹ß»ý
- °á°ú
# rsync_test.sh
spawn rsync -avz -e 'ssh -p 22' ip.sh testuser@192.168.1.10:/test/
Missing trailing-' in remote-shell command.
rsync error: syntax or usage error (code 1) at main.c(361) [sender=3.0.6]
send: spawn id exp4 not open
while executing
"send "passpass\r""
|