把远程机器的文件,同步到本台服务器#!/usr/bin/expectsetpasswd"hd792310"spawnrsync-avzProot@192.168.11.70:/tmp/12.txt/tmp/expect{"yes/no"{send"yes\r"}"password:"{send"$passwd\r"}}expecteof注意:两台服务器都必须安装rsync,否则会报错expecteof必须有,表示结束。..
分类:
其他好文 时间:
2016-03-09 07:09:29
阅读次数:
176
构建文件分发系统1.需求背景对于大公司而言,肯定时不时会有网站或者配置文件更新,而且使用的机器肯定也是好多台,少则几台,多则几十甚至上百台。所以,自动同步文件是至关重要的。2.实现思路首先要有一台模板机器,把要分发的文件准备好,然后只要使用expect脚本批量把需要..
分类:
其他好文 时间:
2016-03-09 07:08:32
阅读次数:
157
用过python assert的朋友应该会经常碰到这样的疑惑,如: (a,b) = (1,'1') assert a==b # error: AssertionError 在代码调试的时候,很难直观的看出为什么错了,除非写成这样: assert 1=='1', "fact==expect, [fac
分类:
编程语言 时间:
2016-03-05 16:22:24
阅读次数:
556
http://www.eclipse.org/ldt/ Lua Development Tools (LDT) is about providing Lua developers with an IDE providing the user experience developers expect
分类:
其他好文 时间:
2016-03-03 10:17:10
阅读次数:
173
http://csharpindepth.com/Articles/General/Unicode.aspx Scope of this page This is a big topic. Don't expect this page to do more than scratch the surf
分类:
Web程序 时间:
2016-03-01 18:41:07
阅读次数:
203
-Android introduces a richer and more complex approach by supporting multiple application entry points. Android programs should expect the system to start them in different places, depending on where...
分类:
移动开发 时间:
2016-02-26 23:42:39
阅读次数:
440
粘贴下readme:#myexpectV1.0released#authchentp0601@qq.com#envdescriptionmyexpectserverrequires:bashisneededofcource expectforanswerpassword vsftpdforclienttodownloadscriptsuploadfilesetc.myexpectclientrequires:ftpforupload wgetfordownload ..
分类:
其他好文 时间:
2016-02-24 09:59:02
阅读次数:
129
想在shell脚本里ssh连接到另外一台服务器后执行一些命令,但是不希望通过交互方式输入登录密码。主要的解决方法有三种:1.生成ssh公钥,建立和对方机器的信任关系;2.使用expect脚本;3.使用sshpass这里介绍一下sshpassyuminstallsshpass-y实例:[root@fsbin]#./sshpass-p12345..
分类:
其他好文 时间:
2016-02-21 18:45:33
阅读次数:
201
目的:每天将A服务器(192.168.0.23)上的文件复制到B服务器(192.168.0.25)上,如果已经存在则不复制。思路:首先统一服务器时间,避免出现莫名的错误或者管理上的混乱。用NTP由于是跨服务器复制,涉及到密码自动录入的问题。需要解决。用scp复制,会覆盖已经存在的文件,增..
分类:
系统相关 时间:
2016-02-02 23:26:22
阅读次数:
539
--stdin表示可以用任意文件做标准输入expect它主要的功能是给ssh进程加个壳,用来传递交互指令。它的核心是spawnexpectsendsetspawn调用要执行的命令expect等待命令提示信息的出现,也就是捕捉用户输入的提示:send发送需要交互的值,替代了用户手动输入内容set设置变量值intera..
分类:
系统相关 时间:
2016-01-29 21:25:18
阅读次数:
379