# Zip task

A Zip packs the files on the list into an archive: one archive for all of them, or one per file.

## Fields

| Field | What it does | On a new task |
|---|---|---|
| **Zip Output Path** | the archive to write, as an address **ending in a file name**: `file:///data/out/reports-{yyyy}{MM}{dd}.zip`. **Browse**, **Test**. | |
| **Internal Zipping** / **External 'zip' Zipping** | **Internal**: the server packs. **External**: the operating system's `zip` program is called; on Linux and macOS only, and not on a server in restricted mode. | Internal |
| **Zip64** | the format for archives over 4 GB, or with more than 65,535 files | off |
| **Delete Original?** | the packed files are deleted when the archive is complete | off |
| **Exclude zip from list?** | the archive is not put on the list | off |
| **Zip each file into their own zip file.** | one archive per file. "Be careful your zip filename is unique such as {stem}.zip." | off |
| **Route connection through DMZ when possible** | the connection is made from a DMZ server | |

### The format goes by the name

| The output path ends in | The archive is |
|---|---|
| `.zip` | zip |
| `.tar` | tar |
| `.tar.gz` | tar, compressed with gzip |
| `.7z` | 7-Zip. Only where both the files and the archive are on the server's own disk (`file://`). |

The path must end in a file name: "Zip output path must contains a filename at the end!"

## What it hands on

| With | The list afterwards holds |
|---|---|
| nothing ticked | the files that were packed, and behind them the archive |
| **Exclude zip from list?** | the files only |
| **Delete Original?** | the archive only: the files are gone from the disk and from the list |
| **Zip each file into their own zip file.** | as above, with one archive per file |

Items the task's filter does not match are not packed and stay on the list.

## Sending only the archive on

After a Zip, the next task usually wants the archive and not the single files. Three ways:

- give the next task the filter `*.zip`, so that it acts on the archive alone;
- tick **Delete Original?**, if the files are not needed afterwards;
- put an [Exclude](Task-Exclude.md) between them.

## Things to know

- **Folders.** A folder on the list goes into the archive with its files, under its name. The paths inside the archive are the items' `{path}`: with a [Find](Task-Find.md) that does not use absolute paths, they begin below the Find's folder.
- **Across servers.** Files on other servers are fetched while packing, and the archive can be written to another server.
- **Originals are deleted last.** With **Delete Original?**, nothing is deleted before the archive is closed. If the Zip fails, the files are all still there.
- **A password on the archive** is not offered. To protect an archive, encrypt it with [PGP](Task-PGP.md) afterwards.
- **One file, compressed, without an archive**: [Compress](Task-Compress.md).
