expect监控 雏形 scp用法
生活随笔
收集整理的這篇文章主要介紹了
expect监控 雏形 scp用法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
scp命令用法: scp? 用戶名@密碼:文件目錄名字 用戶名@密碼:目錄名字 例子: A . scp root@192.168.100.130:/root/atest.txt? /root/btest.txt?? 將遠程機子192.168.100.130上的root下的atest.txt拷貝倒本機并改名為btest.txt B.? scp /root/test1 root@192.168.100.130:/root/test2 將本機的root下的test1 拷貝到遠程的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
實現了自動登陸到 192.168.100.130 并執行命令 ls -l >123.txt
spawn ssh 192.168.100.130
expect "password:" send "123456\r"
send "ls -l > 123.txt\r"
#send "exit"
interact
實現了自動登陸到 192.168.100.130 并執行命令 ls -l >123.txt
轉載于:https://blog.51cto.com/blueicer/88691
總結
以上是生活随笔為你收集整理的expect监控 雏形 scp用法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ping命令时常碰到的问题
- 下一篇: 使用单独的解决方案(类库)来开发DNN的