scp
The scp command is used to transfer files between the local device and the SCP server.
Command Syntax
- Download a file:
- From the ">" prompt, use the following format,
file scp get remote-file <remote-file-path> [local-file local-file-path] ip-address <ip-address>[vrf <mgmt-vrf | vrf-name>]
- From the "#" prompt, add run in front of the command,
run file scp get remote-file <remote-file-path> [local-file local-file-path] ip-address <ip-address>[vrf <mgmt-vrf | vrf-name>]
- Upload a file:
- From the ">" prompt, use the following format,
file scp put local-file <local-file-path> [remote-file <remote-file-path>] ip-address <ip-address>[vrf <mgmt-vrf | vrf-name>]
- From the "#" prompt, add run in front of the command,
run file scp put local-file <local-file-path> [remote-file <remote-file-path>] ip-address <ip-address>[vrf <mgmt-vrf | vrf-name>]
Parameter
Parameter | Description |
get | Download a file. |
put | Upload a file. |
remote-file <remote-file-path> | Specifies the file path on SCP server. The value is a string. |
local-file <local-file-path> | Optional. Specifies the file path on local device. The value is a string. |
ip-address <ip-address>:<port> | Specifies the IPv4/IPv6 address and port for the SCP server. The value is a string. |
vrf <mgmt-vrf | vrf-name> | Optional. Specifies a VRF name. The value is a string that could be mgmt-vrf or a user-defined VRF name.
NOTE:
|
Usage Guidelines
Use the SCP service to upload or download files with the following precautions:
- Usually, the SCP server specifies a directory as the default SCP directory, when using the scp get remote-file <remote-file-path> command, don’t need give the full path for the file, just type the subdirectory of the default directory.
For example, suppose there is a file fileA in the default SCP directory, we can run the following command to download this file:
admin@Xorplus> file scp get remote-file fileA
- On the Pica8 switch, the SCP downloaded file is saved in directory /cftmp/ by default.
Example
- Download file syslog.txt from the root directory of the SCP server to the local device. The IP address of the SCP server is 10.1.1.1. Save the downloaded file to the local device as file syslog.bak.
admin@Xorplus> file scp get remote-file syslog.txt local-file syslog.bak ip-address 10.1.1.1
Copyright © 2024 Pica8 Inc. All Rights Reserved.