954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

FireWall Back ups with Expect

Hello I am about 3 days new to Expect,

I have written a script in expect to automate fire wall back ups. But I want to beable to pull from a list of IPs of the firwalls to telnet to.

then pull the configs to a file and then save the file as the "hostname"month date year-Backup

This is what i have currently and it will save to a specified name. if i specify it.

spawn telnet 10.10.10.2
expect "login:"
Send "user/r"
expect "Password:"
Send "Password/r"
set filename [timestamp -format "Filename fw-%M%D%Y-Backup"]
log_file ./filename.txt

send "get config/r"
expect ">"
Log_file
send "exit/r"

Thank You

Dnal
Newbie Poster
1 post since Oct 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You