expect监控 雏形 scp用法
生活随笔
收集整理的這篇文章主要介紹了
expect监控 雏形 scp用法
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
scp命令用法: scp? 用戶(hù)名@密碼:文件目錄名字 用戶(hù)名@密碼:目錄名字 例子: A . scp root@192.168.100.130:/root/atest.txt? /root/btest.txt?? 將遠(yuǎn)程機(jī)子192.168.100.130上的root下的atest.txt拷貝倒本機(jī)并改名為btest.txt B.? scp /root/test1 root@192.168.100.130:/root/test2 將本機(jī)的root下的test1 拷貝到遠(yuǎn)程的192.168.100.130的root下并改名為test2 expect例子 #!/usr/bin/expect
spawn ssh 192.168.100.130
expect "password:" send "123456\r"
send "ls -l > 123.txt\r"
#send "exit"
interact
實(shí)現(xiàn)了自動(dòng)登陸到 192.168.100.130 并執(zhí)行命令 ls -l >123.txt
spawn ssh 192.168.100.130
expect "password:" send "123456\r"
send "ls -l > 123.txt\r"
#send "exit"
interact
實(shí)現(xiàn)了自動(dòng)登陸到 192.168.100.130 并執(zhí)行命令 ls -l >123.txt
轉(zhuǎn)載于:https://blog.51cto.com/blueicer/88691
總結(jié)
以上是生活随笔為你收集整理的expect监控 雏形 scp用法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: ping命令时常碰到的问题
- 下一篇: CruiseControl中应用NCov