I wanted to backup a brocade san switch configuration, and tried SaveSimplyYourSan - but it wouldn't do ssh - and using telnet, uploading config to ftp - is too unsecure for my taste.
I ended up writing a small expect script that looks like this:
#!/usr/bin/expect #exp_internal 1 set prompt "admin>" set timeout 20 set Machine [lindex $argv 0] spawn ssh -l admin $Machine expect -re $prompt send "configshow -all\r" expect -re $prompt send "exit\n" exit
You put this in /usr/local/bin/savesanconfig.expect and run it with the hostname as the parameter.
The script requires that you have added the ssh public key of the user doing the backup to the admin user on the switch - as to not require login.
I prefer that, to including passwords in scripts :)
0 comments on Backup up your brocade switch config