Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

file archive

Syntax

file archive destination destination source source<compress>

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.

Description

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

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.

Required Privilege Level

maintenance

List of Sample Output

file archive (Multiple Files)
file archive (Single File)
file archive (with Compression)

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 message files in the local directory /var/log/messages as the single file messages-archive.tar.

user@host> file archive source /var/log/messages* destination /var/log/messages-archive.tar
/usr/bin/tar: Removing leading / from absolute path names in the archive.
user@host>

file archive (Single File)

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

user@host> file archive source /var/log/messages destination /var/log/messages-archive.tar
/usr/bin/tar: Removing leading / from absolute path names in the archive.
user@host

file archive (with Compression)

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

user@host> file archive compress source /var/log/messages* destination /var/log/messages-archive.tgz
/usr/bin/tar: Removing leading / from absolute path names in the archive.

Published: 2013-08-15

Published: 2013-08-15