cancel
Showing results for 
Search instead for 
Did you mean: 

Has anyone created an Expect script to backup the configuration file of the ZoneDirector?

dave_hackenberg
New Contributor
I would like to run this as a daily job from my Unix server.
9 REPLIES 9

keith_redfield
Valued Contributor II
Here's a sample using the expect library in Ruby, and involving other commands, but it should give you a good framework to expand on:

http://pivotallabs.com/using-ruby-exp...

keith_redfield
Valued Contributor II
You got me curious so here's a very simple python script (which in this case grabs my standalone AP syslog, then turn control of the session over to me). Uses pexpect which is a very simple python library to provide expect-like controls.


#!/usr/bin/env python
import pexpect #
child = pexpect.spawn ('ssh 192.168.1.10')
child.expect ('Please login:')
child.sendline ('myuserid)
child.expect ('password :')
child.sendline ('mypassword')
child.expect ('rkscli:') # the normal AP prompt
child.sendline ('get syslog log')
print child.before #this object refers to the output of the last child call
child.interact() #puts me on the AP CLI


I used this to verify that 9.7 corrects the "channel 165 blocked" issue (it does)

I think this would be easily adaptable to your need. Pexpect is easy to find on google and installation was trivial.

If you haven't scripted before, python is a pretty gentle introduction with clean syntax and not too many rules about typing variables and such. Lot's of tutorials online as well. Almost any major scripting language will do, so if you already are comfortable with one, most have expect or a variant already installed or installable.

bill_burns_6069
Contributor III

joel_baltazor
New Contributor II
I'm a little dense, what would actual command line usage of this tool look like to download or backup a config from an AP and ZoneDirector ?

Thanks,
Joel