Can I save the results of a script to file?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎07-13-2017 09:38 PM
I need to login to a switch, run a 'show' command, then save the output to a file. I need to do this for 30+ switches, and would preferably like to save the output of each switch's show command to a filename matching it's hostname (SwitchA output to switcha.txt).
I know how to write a script to run the show command, but I don't know how to save it to a file.
Any ideas?
Thank you!
I know how to write a script to run the show command, but I don't know how to save it to a file.
Any ideas?
Thank you!
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎07-17-2017 10:55 AM
You could save the configuration as a script (give it a name) then copy the files from your switch stack, say tftp off. It saves it as an .xsf file if that would work for you. Then you could copy the file off the switch stack to a centralized location. If you have netsight you can automate backups of your stacks.
Slot-1 SwitchA # save configuration as-script SwitchA
Do you want to save configuration to script SwitchA.xsf? (y/N) Yes
Saving configuration to script SwitchA.xsf on master .... done!
Synchronizing script to backup ... done!
Saving script on Standbys (Slots: 3,4).
Script saved on Standby (Slot-4): done!
Script saved on Standby (Slot-3): done!
Slot-1 SwitchA # save configuration as-script SwitchA
Do you want to save configuration to script SwitchA.xsf? (y/N) Yes
Saving configuration to script SwitchA.xsf on master .... done!
Synchronizing script to backup ... done!
Saving script on Standbys (Slots: 3,4).
Script saved on Standby (Slot-4): done!
Script saved on Standby (Slot-3): done!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎07-13-2017 10:04 PM
If you run it as a task you can have it email you the results.
