file archive
Syntax
file archive destinationdestinationsourcesource<compress>Description
Archive, and optionally compress, one or multiple local system files as a single file, locally or at a remote location.
Options
destination—Destination of the archived file or files. Specify the destination as a URL or filename, as described in "How to Specify Filenames and URLs" on page 46. The JUNOS software adds one of the following suffixes if the destination filename does not already have it:
source—Source of the original file or files. Specify the source as a URL or filename, as described in "How to Specify Filenames and URLs" on page 46.
compress—(Optional) Compress the archived file with the GNU zip (gzip) compression utility. The compressed files have the suffix.tgz.Required Privilege Level
List of Sample Output
file archive (multiple files)file archive (single file)file archive (with compression)file archive (multiple files)
The following sample command archives all message files in the local directory
/var/log/messagesas the single filemessages-archive.tarin the same directory: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/messagesas the single filemessages-archive.tarin the same directory: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@hostfile archive (with compression)
The following sample command archives and compresses all message files in the local directory
/var/log/messagesas the single filemessages-archive.tgzin the same directory: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>