linux scp拷贝文件,跳过“yes/no”
来源:互联网 发布:linux输入法 编辑:程序博客网 时间:2024/05/18 16:15
scp_file.sh
#!/usr/bin/expect
if $argc!=2 {
send_user "Usage: expect scp_files.sh remote_ip remote_root_password.\n\n"
exit
}
set remote_ip [lindex $argv 0]
set pwd [lindex $argv 1]
set timeout 120;
spawn /usr/bin/scp /home/dbadmin/public.db root@$remote_ip:/home
set timeout 1
expect {
"*yes/no*" {send "yes\r";exp_continue}
}
expect "*assword*"
send "$pwd\r"
set timeout 100
#!/usr/bin/expect
if $argc!=2 {
send_user "Usage: expect scp_files.sh remote_ip remote_root_password.\n\n"
exit
}
set remote_ip [lindex $argv 0]
set pwd [lindex $argv 1]
set timeout 120;
spawn /usr/bin/scp /home/dbadmin/public.db root@$remote_ip:/home
set timeout 1
expect {
"*yes/no*" {send "yes\r";exp_continue}
}
expect "*assword*"
send "$pwd\r"
set timeout 100
expect eof
linux命令行下执行:
expect scp_files.sh 192.8.8.8 my_password
阅读全文
0 0
- linux scp拷贝文件,跳过“yes/no”
- linux中使用ssh或scp时如何跳过RSA key fingerprint输入yes/no
- linux中使用ssh或scp时如何跳过RSA key fingerprint输入yes/no
- linux中使用ssh或scp时如何跳过RSA key fingerprint输入yes/no
- LINUX SCP 远程 文件 拷贝
- linux 下面SCP拷贝文件
- linux之scp跨主机文件拷贝
- linux服务器之间拷贝文件 scp
- linux scp远程拷贝文件及文件夹
- SCP两台linux主机文件拷贝
- linux scp远程拷贝文件及文件夹
- linux 跨机器文件相互拷贝:scp
- linux scp远程拷贝文件及文件夹
- linux scp远程拷贝文件及文件夹
- linux scp远程拷贝文件及文件夹
- Linux scp --Secure copy 远程拷贝文件
- linux scp远程拷贝文件及文件夹
- linux scp远程拷贝文件及文件夹
- LINK : warning C4727 分析
- JAVA开发的23种设计模式之 --- 备忘录模式
- HTTP Keep-Alive 讲解
- 7-7 字符串替换
- HDU 4841 圆桌问题 (vector模拟)
- linux scp拷贝文件,跳过“yes/no”
- 启动oracle服务批处理
- BZOJ4184: shallot
- xargs应用场景和常见用法
- Android开发之使用PULL解析和生成XML
- Java:集合框架(五)——泛型集合
- 循环有序数组中的二分查找 Search in a rotated sorted array
- 猿题库面试
- Spring Cloud Bus