cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
346
Views
0
Helpful
2
Replies

how to use env variable to creat a config file in CAT9k_IOSXE

schmidtjoe
Level 1
Level 1

Hi there,

I am working on a script to create config output which will be redirected to a remote tftp server. How can I ask the switch to create the config output by using its env variable such as

switch1#show running-config | redirect tftp://......//{{hostname}}.cfg?

Thanks

2 Replies 2

balaji.bandi
Hall of Fame
Hall of Fame

what script you using - is this from inside switch or out of the box. then you need store variable of hostname and backup the config using that hostname, since you already know the device you logged in with hostname, so parse that information from script.

or you can use EEM Script to autobackup to TFTP.

https://www.balajibandi.com/?s=EEM

 

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

schmidtjoe
Level 1
Level 1

Thanks BB. EEM is what I will try.

 

Regards,

Review Cisco Networking for a $25 gift card