用pexpect实现的任务分发工具,可用于pexpect学习
来源:互联网 发布:淘宝假冒伪劣被处罚 编辑:程序博客网 时间:2024/06/01 10:39
最近忙着看书,都没什么时间和大家分享些什么,分享一下前段时间写的分发工具吧,希望对大家有帮助, 主要用于学习pexpect。水平有限,希望大家多多指点,言辞激烈点也没关系,楼主内心强大。
下载地址:
https://github.com/gbwllx/dispatch_server/tree/master
http://download.csdn.net/detail/gbwllx/7923891
主要实现了服务器集群内的文件分发,任务分发,文件下载等功能。
功能初步实现,当然还有很多地方可以改进,主要适用于初学者学习pexpect
需要配置的地方比较少,只要给一个用户名,配置一下机器列表就可以了
主要函数
ssh_cmd() file_upload() download()等
使用方法
usage = "dispatch_server.py [-u][-f][-d][-p][-U]|[-c]|[-s]"
optParser = OptionParser(usage)
group = OptionGroup(optParser,"Auxiliary Funciton Options")
group.add_option("-c","--command",action = "store",type="str",dest = "cmd",
help='''status for process status
kill for kill process
clresult for clear result directory
other string for you can input cmd yourself''')
group.add_option("-s","--slice",action = "store",type="str",dest = "slicefile",nargs=2, help="file to slice")
optParser.add_option_group(group)
optParser.add_option("-d","--download",action = "store_true",dest = "downdir",help="input which directory you want to download")
optParser.add_option("-f","--file",action = "store",type="str",dest = "filename", help="file to check")
optParser.add_option("-p","--print",action = "store_true",dest = "outputinfo", help="if on, output the process infomation")
optParser.add_option("-u","--upload",action = "store_false",dest = "uploaddir", help="if update")
optParser.add_option("-U","--user",action = "store",type="str",dest = "username", default="ffff", help="username")
需配置的机器列表
maclistfile ='%s/dispatch/ffff_maclistfile.txt' %dir
- 用pexpect实现的任务分发工具,可用于pexpect学习
- pexpect模块的学习
- pexpect模块的学习
- Pexpect 模块的学习
- pexpect
- pexpect
- pexpect
- Pexpect学习
- linux下交互式任务的自动化实现(expect&Pexpect)
- pexpect学习笔记
- 学习 pexpect.spawn
- Pexpect学习笔记1
- Pexpect学习笔记2
- 用pexpect做交互式的程序
- Python的Pexpect详解
- python下的Pexpect
- Python的Pexpect详解
- python 的 pexpect模块
- 随想(一)
- 银弹:构件化与SOA,推进软件“福特模式”生产力
- 关于string::size_type
- ACE OLEDB 12.0连接字符串(Excel 2007)
- xib中使用Scrollview无法滑动情况
- 用pexpect实现的任务分发工具,可用于pexpect学习
- svn:error use xcode-select to change
- 【遇见Android bug】requestFeature() must be called before adding content
- SVN删除文件及其恢复
- 2014西安网络赛1008||hdu5014 二进制
- Mockito学习1
- 个推针对android同一包名不同管理台应用的解决方案
- 模拟退火算法(未完善)
- 杭电2588 GCD(欧拉函数+gcd的应用)