Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

file copy

 

Syntax

Release Information

Command introduced before Junos OS Release 7.4.

source-address option added in Junos OS Release 7.4.

Command introduced in Junos OS Release 9.0 for EX Series switches.

Command introduced in Junos OS Release 11.1 for QFX Series switches.

staging-directory option added in Junos OS Release 17.3R1.

Description

Copy files from one location to another location on the local device or to a location on a remote device reachable by the local device.

For information on valid file name and URL formats, see Format for Specifying Filenames and URLs in Junos OS CLI Commands.

Caution

Starting with Junos OS Release 15.1, the sslv3-support option is not available for configuration with the set system services xnm-ssl and file copy commands. SSLv3 is no longer supported and available.

For all releases prior to and including Junos OS Release 14.2, SSLv3 is disabled by default at runtime. The sslv3-support option is hidden and deprecated in Junos OS Release 14.2 and earlier releases. However, you can use the set system services xnm-ssl sslv3-support command to enable SSLv3 for a Junos XML protocol client application to use as the protocol to connect to the Junos XML protocol server on a router, and you can use the file copy source destination sslv3-support command to enable the copying of files from an SSLv3 URL.

Using SSLv3 presents a potential security vulnerability, and we recommend that you not use SSLv3. For more details about this security vulnerability, see the Juniper Networks Knowledge Base articlehere.

Note

If you define an ordered set of ciphers, key exhange methods, or message authentication codes (MACs) at the [edit system services ssh] hierarchy level, the newly-defined set is used when copying files using secure copy protocol (scp). For more information, see Configuring the SSH Service to Support Legacy Cryptography.

Options

sourceSpecify the source URL.
destinationSpecify the destination URL.
source-addresssource-address(Optional) Specify the local address to use in originating the connection.
staging-directory directory-location(Optional) Specify the staging directory on Routing Engine

Required Privilege Level

maintenance

List of Sample Output

Copy a File from the Local Device to a Personal Computer

Copy a Configuration File between Routing Engines

Copy a File Using File Transfer Protocol which Requires a Password

Copy a File Using a Staging Directory

Sample Output

Following are some file copy examples.

Copy a File from the Local Device to a Personal Computer

user@host> file copy /var/tmp/rpd.core.4 mypc:/c/junipero/tmp

Copy a Configuration File between Routing Engines

The following sample command copies a configuration file from Routing Engine 0 to Routing Engine 1:

user@host> file copy /config/juniper.conf re1:/var/tmp/copied-juniper.conf

Copy a File Using File Transfer Protocol which Requires a Password

To use FTP where you require more privacy and are prompted for a password, enter the following command:

root@host> file copy filename ftp://user@hostname/filename

In the following example, /config/juniper.conf is the local file and hostname is the FTP server:

Copy a File Using a Staging Directory

The following sample command copies a file using a staging directory

user@host> file copy re1:/var/tmp/junos-install-x.log /root/ staging-directory /var/tmp/tmp1