码迷,mamicode.com
首页 > 其他好文 > 详细

写了一段批量管理的bash小程序,利用了redhat 原生的expect,wget包组。

时间:2016-02-24 09:59:02      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:expect

粘贴下readme:

#myexpect V1.0 released

#auth chentp0601@qq.com

#env description

myexpect server requires:bash is needed ofcource

expect for answer password

vsftpd for client to down load scripts upload files etc.

myexpect client requires:ftp for upload

wget for down load

python possible if you want to run python scripts  

#file and direcory description

#files in myexpect server

tree /server-scripts

/server-scripts :scripts in myexpect server

├── exc-py.sh :you can use exec-py.sh [yourscript.py] to run python scripts on hosts defined in hosts

├── exc-sh.sh :you can use exec-sh.sh [yourscript.sh] to run bash scripts on hosts defined in hosts

├── hosts.pass :host file likes [ip port username password],you ‘d better change it before use it

├── mrelease.sh :run this scripts to cp files in /var/ftp/pub to hosts defined in hosts.pass

└── ssh.exp :this file is used to answer what you asked in shell scripts


tree /var/ftp/pub/ :you can put you scripts here,and it will be run on hosts defined in hosts.pass when you run exc-py or exc-sh on myexpect-server

/var/ftp/pub/

├── gatherinformation-2.0.py :python scripts

├── oscheck.sh :bash scripts

├── storage_check.sh :bash scripts

└── uploadreport.sh :bash scripts


#files in myexpect client

tree /client-scripts/

/client-scripts/

├── gatherinformation-2.0.py :python scripts

├── oscheck.sh :bash scripts

├── storage_check.sh :bash scripts

└── uploadreport.sh :bash scripts



#how to use myexpect?

1)put yourscript in /var/ftp/pub

2)/server-scripts/mrelease

3)/server-scripts/exc-sh [yourscript.sh]


本文出自 “前进吧菜鸟” 博客,请务必保留此出处http://chentp.blog.51cto.com/10638759/1744436

写了一段批量管理的bash小程序,利用了redhat 原生的expect,wget包组。

标签:expect

原文地址:http://chentp.blog.51cto.com/10638759/1744436

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!