Copying Files to or from Cisco NX-OS
You might need to move files to or from the device. These files may include the log, configuration, or firmware
files.
Cisco NX-OS offers protocols to use for copying to or from the device. The device always acts as a client, so
that an FTP, SCP, or TFTP session always originates from Cisco NX-OS and either pushes files to an external
system or pulls files from an external system.
File Server: 172.22.36.10
File to be copied to the switch: /etc/hosts
The copy command supports the FTP, SCP, SFTP, and TFTP transfer protocols and many different sources
for copying files.
switch# copy ?
bootflash: Select source filesystem
core: Select source filesystem
debug: Select source filesystem
ftp: Select source filesystem
http: Select source filesystem
https: Select source filesystem
licenses Backup license files
log: Select source filesystem
logflash: Select source filesystem
nvram: Select source filesystem
running-config Copy running configuration to destination
scp: Select source filesystem
sftp: Select source filesystem
startup-config Copy startup configuration to destination
system: Select source filesystem
tftp: Select source filesystem
usb1: Select source filesystem
usb2: Select source filesystem
volatile: Select source filesystem
You can use secure copy (SCP) as the transfer mechanism, as follows:
scp:[//[username@]server][/path]
This example copies /etc/hosts from 172.22.36.10 to hosts.txt, for user user1:
switch# copy scp://user1@172.22.36.10/etc/hosts bootflash:hosts.txt
user1@172.22.36.10's password:
hosts 100% |*****************************| 2035 00:00
This example backs up the startup configuration to an SFTP server:
switch# copy startup-config sftp://user1@172.22.36.10/test/startup configuration.bak1
Connecting to 172.22.36.10...
User1@172.22.36.10's password:
switch#
You should back up the startup configuration to a server on a daily basis and prior to any changes. You
could write a short script to run on Cisco NX-OS to perform a save and then a backup of the configuration.
The script needs to contain two commands: copy running-configuration startup-configuration and
copy startup-configuration tftp://server/name. To execute the script, use the run-script filename
command.
Note
Cisco Nexus 9000 Series NX-OS Troubleshooting Guide, Release 7.x
91
Before Contacting Technical Support
Copying Files to or from Cisco NX-OS