I am planning to make a simple script for logging on to a switch & take the configuration backup!
I used to login manually & want to do this in a single command or through a script!
Anyone could help me out?
root@xxx:/home# ftp xxx.19.254.61
Connected to xxx.19.254.61.
220 xx-xx-xx-xxx-SW-2 FTP version 1.0 ready at Sat Feb 14 23:28:25 1970
Name (xxx.19.254.61:root): admin
331 Enter PASS command
Password:
230 Logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> get config config.cfg
local: config.cfg remote: config
200 Port command okay
150 Opening data connection for RETR config
226 File sent OK
2824 bytes received in 1.05 secs (2.6227 kB/s)
ftp> bye
221 Goodbye!
i wrote something similar here
(Note: you should
mkdir
because ftp not support multiple file copies from source to destination folder so you should use mget with -R option to multiple files which located in new created directory then copy your config files to this new created directory withcp -avr config* $source_folder
).instructions :
Example :
P@$$w0rd (password_to_encrypt (private key))
P@$$w0rd same password_to_encrypt (private key)
P@$$w0rd same password_to_decrypt (private key)
Note:
you can delete those lines if you don't want pair key encryption with openssl connection
and change
quote PASS $decrypt
toquote PASS $ftp_password
Alternative: Just Put Your
Username
andPassword
andServer Ip
Like172.19.254.61
Now Your Config Files downloaded here in
/home/rr-de-nms-1/Sazzad/dest_folder/