I Would like to backup my switchs/routers configuration cisco automatically.
I try to create this script :
from netmiko import ConnectHandler
cisco_test = {
'device_type': 'cisco_ios',
'host': 'xxx.xxx.xxx.xxx',
'username': 'xxxxxx',
'password': 'xxxxxxxxxx',
'secret': 'xxxxxxx',
}
net_connect = ConnectHandler(**cisco_test)
net_connect.enable()
config_commands = ['copy start tftp://xxx.xxx.xxx.xxx/test.bin']
output = net_connect.send_config_set(config_commands)
print(output)
net_connect.exit_enable_mode()
But it doesn't work... Could you show me how to do that ?