<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Cisco Nexus  Backup Python Script in Nexus Devices</title>
    <link>https://community.cisco.com/t5/nexus-devices/cisco-nexus-backup-python-script/m-p/5363109#M558</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1443554"&gt;@uni1389&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your pasted output is correct, it looks like your script never hits the if-statements after the copy command. Can you add some "debug-prints" to verify and paste the output:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;from datetime import datetime
from getpass import getpass
from netmiko import ConnectHandler
import time
import os

today = str(datetime.now().strftime('%d%m%Y%H%M'))
filename = (today +  "_Switch.txt")
print('******************************************************************************')
password = getpass()
ipaddrs = ["192.168.3.71","192.168.3.72"]
devices = [
    {
        "device_type": "cisco_nxos",
        "host": ip,
        "username": "admin",
        'password': 'cisco',
        'port' : 22,          # optional, defaults to 22
        'secret': 'cisco',
    }
    for ip in ipaddrs
]
for ip in ipaddrs:
    response = os.popen('ping ' + ip).read()
    if 'Received = 4' in response:
        print(ip, 'is up')
    else:
        print(ip, 'is down')
tftp = input('**** Enter TFTP server IP addr **** :- ')
for device in devices:
    print('******************************************************************************\n')
    print(f'Connecting to the IP/Device... {device["host"]}')
    net_connect = ConnectHandler(**device)
    gethostname= net_connect.send_command('sh run | i host').split()[1]
    showint = net_connect.send_command('show int mgmt0 | inc  Internet')
    showver = net_connect.send_command('show version | inc .bin')
    print("Successfully Connected to.... "+gethostname)
    filename = (gethostname+  ".txt")
    copy_cmd = "copy running-config tftp: vrf management"
    net_connect.enable()
    time.sleep(1)
    output1 = net_connect.send_command_timing(copy_cmd)
    print(output1)
    if 'Source filename' in output1:      
        output1 += net_connect.send_command_timing('\n')
        print(output1)
    if 'remote host' in output1:
        output1 += net_connect.send_command_timing(tftp)
        print(output1)
    if 'Destination filename' in output1:
        output1 += net_connect.send_command_timing(filename)
        print(output1)
    print (output1)
 
print('******************************************************************************\n')    
print('Backup Completed Successfully....')
print('*&lt;/LI-CODE&gt;
&lt;P&gt;If you don't see the expected ouput, you may need to tweak your commands and make sure to include the prompts:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;    output1 = net_connect.send_command_timing(copy_cmd, strip_prompt=False, strip_command=False)
    print(output1)
    if 'Source filename' in output1:      
        output1 += net_connect.send_command_timing('\n', strip_prompt=False, strip_command=False)
        print(output1)
    if 'remote host' in output1:
        output1 += net_connect.send_command_timing(tftp, strip_prompt=False, strip_command=False)
        print(output1)
    if 'Destination filename' in output1:
        output1 += net_connect.send_command_timing(filename, strip_prompt=False, strip_command=False)
        print(output1)
    print (output1)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;PS: If copy via SCP is an option for you, check out Netmikos secure copy support, it might be easier:&amp;nbsp;&lt;A href="https://pynet.twb-tech.com/blog/expanding-netmiko-secure-copy-support.html" target="_blank" rel="noopener"&gt;https://pynet.twb-tech.com/blog/expanding-netmiko-secure-copy-support.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jan 2026 07:42:53 GMT</pubDate>
    <dc:creator>Marcel Zehnder</dc:creator>
    <dc:date>2026-01-20T07:42:53Z</dc:date>
    <item>
      <title>Cisco Nexus  Backup Python Script</title>
      <link>https://community.cisco.com/t5/nexus-devices/cisco-nexus-backup-python-script/m-p/5362789#M557</link>
      <description>&lt;DIV&gt;&lt;FONT color="#000000"&gt;Hello Team ,&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;am using python script to do TFTP configuration&amp;nbsp; backup , but am not able to backup as it shows no errors after complete script execution. If I try to do from directly from Nexus device it is working fine.&amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;from datetime import datetime&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;from getpass import getpass&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;from netmiko import ConnectHandler&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;import time&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;import os&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;#today = str(datetime.now().strftime('%Y-%m-%d-%H-%M'))&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;today = str(datetime.now().strftime('%d%m%Y%H%M'))&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;filename = (today + &amp;nbsp;"_Switch.txt")&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;print('******************************************************************************')&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;password = getpass()&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;ipaddrs = ["192.168.3.71","192.168.3.72"]&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;devices = [&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; {&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "device_type": "cisco_nxos",&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "host": ip,&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "username": "admin",&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'password': 'cisco',&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'port' : 22, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# optional, defaults to 22&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'secret': 'cisco',&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; }&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; for ip in ipaddrs&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;]&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;for ip in ipaddrs:&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; response = os.popen('ping ' + ip).read()&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; if 'Received = 4' in response:&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(ip, 'is up')&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; else:&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(ip, 'is down')&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;tftp = input('**** Enter TFTP server IP addr **** :- ')&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;for device in devices:&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; print('******************************************************************************\n')&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; print(f'Connecting to the IP/Device... {device["host"]}')&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; net_connect = ConnectHandler(**device)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp;# getping = net_connect.send_command('show interface brief')&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp;# print(getping)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; gethostname= net_connect.send_command('sh run | i host').split()[1]&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; #print(gethostname)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; showint = net_connect.send_command('show int mgmt0 | inc &amp;nbsp;Internet')&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; #print(showint)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; showver = net_connect.send_command('show version | inc .bin')&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; #print(showver)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; print("Successfully Connected to.... "+gethostname)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; #filename = (today + "-"+gethostname+ &amp;nbsp;".txt")&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; filename = (gethostname+ &amp;nbsp;".txt")&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; copy_cmd = "copy running-config tftp: vrf management"&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; net_connect.enable()&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; time.sleep(1)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; output1 = net_connect.send_command_timing(copy_cmd)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; if 'Source filename' in output1: &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output1 += net_connect.send_command_timing('\n')&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; if 'remote host' in output1:&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output1 += net_connect.send_command_timing(tftp)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; if 'Destination filename' in output1: &lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output1 += net_connect.send_command_timing(filename)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; print (output1)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;print('******************************************************************************\n') &amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;print('Backup Completed Successfully....')&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#000000"&gt;print('******************************************************************************')&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Output is following&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&amp;gt; python3 .\CiscoTFTPBackupNexusTestedOK.py &lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;******************************************************************************&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Password: &lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;192.168.3.71 is up&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;192.168.3.72 is up&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;**** Enter TFTP server IP addr **** :- 192.168.0.26&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;******************************************************************************&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Connecting to the IP/Device... 192.168.3.71&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Successfully Connected to.... DC01-NX-BL-71&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;******************************************************************************&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Connecting to the IP/Device... 192.168.3.72&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Successfully Connected to.... DC01-NX-BL02-72&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;******************************************************************************&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Backup Completed Successfully....&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;******************************************************************************&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Directly from device it is working fine.&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;DC01-NX-BL-71(config-line)# copy running-config tftp: vrf management &lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Enter destination filename: [DC01-NX-BL-71-running-config] &lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Enter hostname for the tftp server: 192.168.0.26&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Trying to connect to tftp server......&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Connection to Server Established.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;TFTP put operation was successful &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 19 Jan 2026 11:41:25 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nexus-devices/cisco-nexus-backup-python-script/m-p/5362789#M557</guid>
      <dc:creator>uni1389</dc:creator>
      <dc:date>2026-01-19T11:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco Nexus  Backup Python Script</title>
      <link>https://community.cisco.com/t5/nexus-devices/cisco-nexus-backup-python-script/m-p/5363109#M558</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1443554"&gt;@uni1389&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your pasted output is correct, it looks like your script never hits the if-statements after the copy command. Can you add some "debug-prints" to verify and paste the output:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;from datetime import datetime
from getpass import getpass
from netmiko import ConnectHandler
import time
import os

today = str(datetime.now().strftime('%d%m%Y%H%M'))
filename = (today +  "_Switch.txt")
print('******************************************************************************')
password = getpass()
ipaddrs = ["192.168.3.71","192.168.3.72"]
devices = [
    {
        "device_type": "cisco_nxos",
        "host": ip,
        "username": "admin",
        'password': 'cisco',
        'port' : 22,          # optional, defaults to 22
        'secret': 'cisco',
    }
    for ip in ipaddrs
]
for ip in ipaddrs:
    response = os.popen('ping ' + ip).read()
    if 'Received = 4' in response:
        print(ip, 'is up')
    else:
        print(ip, 'is down')
tftp = input('**** Enter TFTP server IP addr **** :- ')
for device in devices:
    print('******************************************************************************\n')
    print(f'Connecting to the IP/Device... {device["host"]}')
    net_connect = ConnectHandler(**device)
    gethostname= net_connect.send_command('sh run | i host').split()[1]
    showint = net_connect.send_command('show int mgmt0 | inc  Internet')
    showver = net_connect.send_command('show version | inc .bin')
    print("Successfully Connected to.... "+gethostname)
    filename = (gethostname+  ".txt")
    copy_cmd = "copy running-config tftp: vrf management"
    net_connect.enable()
    time.sleep(1)
    output1 = net_connect.send_command_timing(copy_cmd)
    print(output1)
    if 'Source filename' in output1:      
        output1 += net_connect.send_command_timing('\n')
        print(output1)
    if 'remote host' in output1:
        output1 += net_connect.send_command_timing(tftp)
        print(output1)
    if 'Destination filename' in output1:
        output1 += net_connect.send_command_timing(filename)
        print(output1)
    print (output1)
 
print('******************************************************************************\n')    
print('Backup Completed Successfully....')
print('*&lt;/LI-CODE&gt;
&lt;P&gt;If you don't see the expected ouput, you may need to tweak your commands and make sure to include the prompts:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;    output1 = net_connect.send_command_timing(copy_cmd, strip_prompt=False, strip_command=False)
    print(output1)
    if 'Source filename' in output1:      
        output1 += net_connect.send_command_timing('\n', strip_prompt=False, strip_command=False)
        print(output1)
    if 'remote host' in output1:
        output1 += net_connect.send_command_timing(tftp, strip_prompt=False, strip_command=False)
        print(output1)
    if 'Destination filename' in output1:
        output1 += net_connect.send_command_timing(filename, strip_prompt=False, strip_command=False)
        print(output1)
    print (output1)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;PS: If copy via SCP is an option for you, check out Netmikos secure copy support, it might be easier:&amp;nbsp;&lt;A href="https://pynet.twb-tech.com/blog/expanding-netmiko-secure-copy-support.html" target="_blank" rel="noopener"&gt;https://pynet.twb-tech.com/blog/expanding-netmiko-secure-copy-support.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 07:42:53 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nexus-devices/cisco-nexus-backup-python-script/m-p/5363109#M558</guid>
      <dc:creator>Marcel Zehnder</dc:creator>
      <dc:date>2026-01-20T07:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco Nexus  Backup Python Script</title>
      <link>https://community.cisco.com/t5/nexus-devices/cisco-nexus-backup-python-script/m-p/5363159#M559</link>
      <description>&lt;P&gt;i use below both EEM and Python check :&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.balajibandi.com/?p=717" target="_blank"&gt;https://www.balajibandi.com/?p=717&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.balajibandi.com/?p=1437" target="_blank"&gt;https://www.balajibandi.com/?p=1437&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 08:23:52 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nexus-devices/cisco-nexus-backup-python-script/m-p/5363159#M559</guid>
      <dc:creator>balaji.bandi</dc:creator>
      <dc:date>2026-01-20T08:23:52Z</dc:date>
    </item>
  </channel>
</rss>

