BACKRUSH  À¯´Ð½º¸í·É  ´ÙÀ½  ÀÚ·á½Ç  Ascii Table   ¿ø°ÝÁ¢¼Ó  ´Þ·Â,½Ã°£   ÇÁ·Î¼¼½º   ½©
ÁöÇÏö³ë¼±   RFC¹®¼­   SUN FAQ   SUN FAQ1   C¸Þ´º¾ó   PHP¸Þ´º¾ó   ³Ê±¸¸®   ¾Æ½ºÅ°¿ùµå ¾ÆÀÌÇǼ­Ä¡

±Û¾´ÀÌ: expect expect + rsync Á¶È¸¼ö: 3270


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""

°ü·Ã±Û : ¾øÀ½ ±Û¾´½Ã°£ : 2021/05/21 21:51 from 122.32.218.68

  MS OFFice Á¤Ç°°ü·Ã ¸ñ·Ïº¸±â »õ±Û ¾²±â Áö¿ì±â ÀÀ´ä±Û ¾²±â ±Û ¼öÁ¤ yum ¾ÈµÉ¶§  
BACKRUSH  À¯´Ð½º¸í·É  ´ÙÀ½  ÀÚ·á½Ç  Ascii Table   ¿ø°ÝÁ¢¼Ó  ´Þ·Â,½Ã°£   ÇÁ·Î¼¼½º   ½©
ÁöÇÏö³ë¼±   RFC¹®¼­   SUN FAQ   SUN FAQ1   C¸Þ´º¾ó   PHP¸Þ´º¾ó   ³Ê±¸¸®   ¾Æ½ºÅ°¿ùµå ¾ÆÀÌÇǼ­Ä¡