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
For archived files—The suffix
.tar
For archived and compressed files—The suffix
.tgz
.tgz
.Required Privilege Level
maintenance
Related Documentation
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
/usr/bin/tar: Removing leading / from absolute path names in the archive.
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
/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 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
/usr/bin/tar: Removing leading / from absolute path names in the archive.
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