Python-Cisco-Backup icon indicating copy to clipboard operation
Python-Cisco-Backup copied to clipboard

Cisco Backup

Open bbbulsara opened this issue 9 months ago • 6 comments

Hi Alex, It's not actually a issue. but i totally new to Python and I loved your Python-Cisco-Backup for my switch backups. Only thing i want to know as it only doing "show run" and putting output in a file,

Is there any way we can added multiple command to run and put in same output file.

i want this commands to be added but output should be in same file.

show run show ver show inv show cdp nei show IP route show interface summ show vlan show ospf nei show license all

bbbulsara avatar Apr 01 '25 08:04 bbbulsara

Hi, sure! You can use my forked and improved version: https://github.com/ste-giraldo/python3-cisco-config there are also other versions for different vendors, check my repository.

ste-giraldo avatar Apr 01 '25 09:04 ste-giraldo

Mine natively doesn't support that, it's just straight for copying configs from different devices. I'm sure it could easily be modified to do that fairly easily. I believe you would just need to either keep adding to the same .txt file, or reopen it with each command you want to write to the file. I'd take a look at @ste-giraldo repository that he linked above my comment. His is more updated, and he is one of the original contributors of this repository :)

AlexMunoz905 avatar Apr 01 '25 13:04 AlexMunoz905

For the changes, you would need to go in the vendor-backups folder, and to the specific python file for the devices your using, I think in your case, cisco-ios.py.

If you create it or have any questions, feel free to make a pull-request! I'm not against the idea of adding other commands to the automation. I mainly created this script for backing up my network with Cron.

AlexMunoz905 avatar Apr 01 '25 13:04 AlexMunoz905

@ste-giraldo Thank you, but i got a issue with running multiple command request:. error Squeezed text (1156 lines) Pop-Up: Kill? your program is still running! do you want to kill it? If i kill it or cancel it it still created the file, do i worry about it?

bbbulsara avatar Apr 03 '25 08:04 bbbulsara

@AlexMunoz905 i was trying to get with GUI as it easy for my team who does know python at all. I tried to make pull-request but didn't work for me. Unsure how to add the command with your script to get all this command run at once? @ste-giraldo works for sure. @ste-giraldo are you planning to make with GUI interface as well ?

bbbulsara avatar Apr 03 '25 08:04 bbbulsara

Hi, not in plan to build a GUI at the moment. The tool is mainly meant to be used as a crontab job for config backup or massive changes on the network. In my repo you can see the readme with the usage and also the screenshots of the runs

ste-giraldo avatar Apr 03 '25 10:04 ste-giraldo