Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

file archive

Syntax

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 destination

Destination 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 source

Source 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.

exclude (Optional) Specify the file pattern to exclude. exclude helps to exclude files that delay compression or files that need not be compressed.
routing-instance routing-instance-name (Optional) Name of the routing-instance.
source-address address (Optional) Local address to use in originating the connection.

Required Privilege Level

maintenance

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.

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.

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.

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:

File Archive Compress (with Exclude Option)

The following sample command archives and compresses all messages files in the local directory /var/log/ and excludes the single file pattern specified.

Release Information

Command introduced before Junos OS Release 7.4.

exclude option added in Junos OS Release 20.3R1 and Junos OS Evolved Release 20.3R1.

routing-instance option added in Junos OS Release 18.4R1.

source-address option added in Junos OS Release 18.4R1.