# <tar>

Creates a tar file from the specified filesets.

Uses #ziplib (SharpZipLib), an open source Tar/Zip/GZip library written entirely in C#.

### Parameters

Attribute | Type | Description | Required
--- | --- | --- | ---
destfile | file | The tar file to create. | True
compression | TarCompressionMethod | The compression method. The default is `None`. | False
includeemptydirs | bool | Include empty directories in the generated tar file. The default is false. | False
failonerror | bool | Determines if task failure stops the build, or is just reported. The default is true. | False
if | bool | If true then the task will be executed; otherwise, skipped. The default is true. | False
unless | bool | Opposite of `if`. If false then the task will be executed; otherwise, skipped. The default is false. | False
verbose | bool | Determines whether the task should report detailed build log messages. The default is false. | False

### Nested Elements:

#### <fileset>

The set of files to be included in the archive.

#### </fileset>

### Examples

- Tar all files in `${build.dir}` and `${doc.dir}` into a file called "backup.tar.gz", and apply gzip compression to it.

                  <tar destfile="backup.tar.gz" compression="GZip">
                      <fileset basedir="${bin.dir}" prefix="bin">
                          <include name="**/*" />
                      </fileset>
                      <fileset basedir="${doc.dir}" prefix="doc">
                          <include name="**/*" />
                      </fileset>
                  </tar>

### Requirements

Assembly: NAnt.CompressionTasks (0.91.4312.0)