首页 > 代码库 > 脚本 用 scp 拷贝文件

脚本 用 scp 拷贝文件

 

#!/usr/bin/expectset proj_dir /home/jksong/NewsSpark/openid_for_commonidset tmp_data_dir $proj_dir/data_src/openid_dirset password yourpasswordspawn scp -r $tmp_data_dir news@10.49.94.67:/data/news/data/commid_stroage_server/originalset timeout 300for {} {1} {} {     expect {        "*re you sure you want to continue connecting (yes/no)?" {            send "yes\r"         }                "*assword:" {            send "$password\r"        }                "*ermission denied*" {            break               }               "*No route to host" {            break        }        "*No such file or directory" {            break        }        timeout {            break        }        eof {            break        }    }}interactexit

 

脚本 用 scp 拷贝文件