Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

file archive

 

Syntax

Release Information

Command introduced before 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 the QFX Series.

Command introduced in Junos OS Release 14.1X53-D20 for OCX Series switches.

Description

Archive, and optionally compress, one or multiple local system files as a single file, locally or at a remote location.

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

Options

destination destinationDestination of the archived file or files. Specify the destination as a URL or filename. The Junos OS adds one of the following suffixes if the destination filename does not already have it:
  • For archived files—The suffix .tar

  • For archived and compressed files—The suffix .tgz

source sourceSource of the original file or files. Specify the source as a URL or filename.
compress(Optional) Compress the archived file with the GNU zip (gzip) compression utility. The compressed files have the suffix .tgz.

Required Privilege Level

maintenance

List of Sample Output

file archive (Multiple Files)

file archive (Single File)

file archive (with Compression)

File Archive Using Secure Copy Protocol (scp) with ’source-address’ and ’routing-instance’ options

Output Fields

When you enter this command, you are provided feedback on the status of your request.

Sample Output

file archive (Multiple Files)

The following sample command archives all messages files in the local directory /var/log/ as the single file messages-archive.tar.

user@host> file archive source /var/log/messages* destination /var/log/messages-archive.tar
user@host>



file archive (Single File)

The following sample command archives a single messages file in the local directory /var/log/ as the single file messages-archive.tar.

user@host> file archive source /var/log/messages destination /var/log/messages-archive.tar
user@host>



file archive (with Compression)

The following sample command archives and compresses all messages files in the local directory /var/log/ as the single file messages-archive.tar.

user@host> file archive compress source /var/log/messages* destination /var/log/messages-archive.tgz
user@host>

File Archive Using Secure Copy Protocol (scp) with ’source-address’ and ’routing-instance’ options

To use the scp command to archive a file with the source-address and routing-instance options, enter the following command:

user@host> file archive source source destination scp:// destination source-address address routing-instance instance-name