初试expect
来源:互联网 发布:一键上传淘宝的危害 编辑:程序博客网 时间:2024/05/22 10:37
今天刚看到expect这个好玩的东西,顺便试了试。
download_err_log.sh
#!/bin/bash# desc - 登录远程服务器 打包相关文件, 并把文件download到本地# anthor - wangdadou# time - 2016-05-14 16:41date=`date '+%Y-%m-%d'`remote_user_name='root'remote_ip='123.59.61.216'remote_path='/data/2016-05-14-err_log.zip'my_online_log_path='/Users/wangjia/java/online_data/online_log/'./ssht_pack_err_log.sh ${date}echo "start the remote log file!"scp ${remote_user_name}@${remote_ip}:${remote_path} ${my_online_log_path}echo "the log file has been download to ${my_path}"exit 0
ssho_pack_err_log.sh
#!/usr/bin/expectset timeout 3set errlog_path "/data/"set log_dirname "logpath"set date [lindex $argv 0]spawn ./ssht123-59-61-216.shsend "cd ${errlog_path} \r"send "zip -r ${date}-err_log.zip ${log_dirname}\r"send "exit\r"interact
ssht123-59-61-216.sh
#!/bin/bashssh root@123.59.61.216
每次看到好玩的东西总是兴奋的停不下来!!!
0 0
- 初试expect
- Expect
- expect
- expect
- expect
- Expect
- expect
- expect
- expect
- expect
- expect
- expect
- expect
- expect
- expect
- expect
- expect
- expect
- 某正整数列{n},当n的平方为回文数的时候,输出n
- 怎么在bios中禁用独显
- ACM解题的几个技巧
- Matlab读取excel数据,并绘图生成exe可执行文件
- 创建可执行的JAR包
- 初试expect
- A*启发式搜索
- Windows7上使用VMware安装MacOS虚拟机
- list的用法,基本把所有成员试了一遍
- 搭建高可用mongodb集群(三)—— 深入副本集内部机制
- 计算机软件工程大学排名(2015)
- PTA 5-38 数列求和-加强版
- 有趣的数
- 2016"百度之星" - 资格赛(Astar Round1)Problem B