copy FILE1 FILE2

Copies a flash or USB file to a remote server and vice versa.

Syntax

copy FLASH-FILE FLASH-FILE
copy FLASH-FILE USB-FILE
copy FLASH-FILE REMOTE-FILE
copy USB-FILE FLASH-FILE
copy USB-FILE USB-FILE
copy USB-FILE REMOTE-FILE
copy REMOTE-FILE FLASH-FILE
copy REMOTE-FILE USB-FILE

Parameters

FLASH-FILE
Specifies the flash file path in format flash://flash-type/file-name.
REMOTE-FILE
Specifies the remote server file path in format scp://username:password@host[:port]/filepath.
Domain name, IPv4 address, and IPv6 address are supported as host. Only valid unicast IP addresses are supported, multicast IP addresses are not supported.
USB-FILE
Specifies the USB file path in format usb://file-name.

Modes

Exec mode

Usage Guidelines

This command is available only to users with admin role.

Valid user credentials must be provided for accessing the remote server.

Input file path must be valid.

Target destination must be reachable.

Copying a file from one remote server to another remote server is not supported.

Examples

The following example copies a file from the USB to a remote location.

device# copy usb://testfile   scp://testuser:testpassword@1.1.1.1:22/home/testuser/test123
The following examples show error messages.

Invalid input file:

device# copy flash://config-file/test scp://test:test@1.1.1.1:/home/test/file  
Error: Input file does not exist 

USB not enabled:

device# copy usb://test scp://test:test@1.1.1.1:/home/test/file  
Error: USB not enabled 

Invalid target file:

device# copy flash://config-file/test scp://test:test@1.1.1.1:/home/test/file  
Error: Target file does not exist

Invalid user credentials:

device# copy flash://config-file/test scp://test:test@1.1.1.1:/home/test/file  
Error: Invalid user credentials. 

Host IP not reachable:

device# copy flash://config-file/test scp://test:test@1.1.1.1:/home/test/file  
Error: Host IP not reachable

Unsupported copy commands:

device# copy scp://prabhus:pr@10.23.17.131:/home/prabhus/testfile1 
scp://prabhus:pr@10.23.17.131:/home/prabhus/testfile2 
Error: The source and destination cannot both be remote.