MapR 5.0 Documentation : hadoop archive

The hadoop archive command creates a Hadoop archive, a file that contains other files. A Hadoop archive always has a *.har extension.

Syntax

hadoop [ Generic Options ] archive
    -archiveName <name>
    [-p <parent>]
    <source>
    <destination>

Parameters

Parameter

Description

-archiveName <name>

Name of the archive to be created.

-p <parent_path>

The parent argument is to specify the relative path to which the files should be archived to.

<source>

Filesystem pathnames which work as usual with regular expressions.

<destination>

Destination directory which would contain the archive.

Examples

Archive within a single directory

hadoop archive -archiveName myArchive.har -p /foo/bar /outputdir

The above command creates an archive of the directory /foo/bar in the directory /outputdir.

Archive to another directory

hadoop archive -archiveName myArchive.har -p /foo/bar a/b/c e/f/g

The above command creates an archive of the directory /foo/bar/a/b/c in the directory /foo/bar/e/f/g.