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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了写了一段批量管理的bash小程序,利用了redhat 原生的expect,wget包组。相关的知识,希望对你有一定的参考价值。

粘贴下readme:

#myexpect V1.0 released

#auth [email protected]

#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包组。的主要内容,如果未能解决你的问题,请参考以下文章

上午写了一段代码,下午就被开除了...

上午写了一段代码,下午就被开除了,奇怪的知识又增加了

利用pillow库(PIL)批量修改图片尺寸

上午写了一段代码,下午就被开除了,奇怪的知识又增加了

上午写了一段代码,下午就被开除了,奇怪的知识又增加了

上午写了一段代码,下午就被开除了,奇怪的知识又增加了