Quick script - backup multiple Alcatel OmniSwitch configuration files

A quick batch script I did to backup configuration files of multiple Alcatel Omniswitch via FTP.

In the switch flash all configuration files are named boot.cfg so the script renames each file appending the IP address of the device to avoid conflicts.

We start creating a file with all the IP of switches to backup

Filename

iplist.txt

Content

10.10.29.10
10.12.29.10
10.14.29.10
10.14.29.11
10.14.29.12
10.14.29.13
10.14.29.14
10.14.29.15

Now create a FTP script to login and backup the configuration

Filename

ftp.scr

Note: user admin password switch are defaults on Omniswitch

Content

admin
switch
cd ..
cd working
get boot.cfg
quit

Now we can create the actual script that will perform the backup

Filename

getconfig.bat

Content

for /f "tokens=*" %%i in (iplist.txt) do (
echo %%i
ftp -s:ftp.scr %%i
ren boot.cfg boot.cfg-%%i )

Now we just have to run the script and see the magic happen!

 
comments powered by Disqus