# Create Hook

## Create a Hook

Open the **Hooks** page from **Backup & Recovery**.

Click **Create New** in the top-right corner.

<figure><img src="https://content.gitbook.com/content/9sDjF5HJP1bf8TtLcgkk/blobs/6GMQ0aCNmWikevKNJ8Tx/create%20ne%20w%20hook.jpeg" alt=""><figcaption></figcaption></figure>

The **Create Hook** dialog opens.

<figure><img src="https://1939071994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9sDjF5HJP1bf8TtLcgkk%2Fuploads%2FhMQAXrcLI5Uwo3mYIiOO%2Fcreate-hook.png?alt=media&#x26;token=dd3e8121-84ed-4eec-a4ad-aa472f61259c" alt=""><figcaption></figcaption></figure>

### Fields

1. **Namespace**: Select the namespace where the hook will be created.
2. **Name**: Enter a name for the hook.
3. **PRE**: Commands that run **before** a backup or snapshot.
   * This section is optional.
   * If you fill in any field, all **PRE** fields become required.
   * To clear the **PRE** fields, click **Clear**.
   * **Ignore failure**: If enabled, TVK ignores failures for pre-hook execution.
   * **Timeout (sec)**: Mark the hook as failed if it does not complete in time.
   * **Max retry count**: Maximum retry attempts for the command.
   * **Command**: Command to run. Include the shell and args (for example, `bash -c "<command>"`).
4. **POST**: Commands that run **after** a backup or snapshot.
   * If you fill in any field, all **POST** fields become required.
   * To clear the **POST** fields, click **Clear**.
   * **Ignore failure**: If enabled, TVK ignores failures for post-hook execution.
   * **Timeout (sec)**: Mark the hook as failed if it does not complete in time.
   * **Max retry count**: Maximum retry attempts for the command.
   * **Command**: Command to run. Include the shell and args (for example, `bash -c "<command>"`).
5. **Create**: Create the hook.
6. **Cancel**: Close the dialog without saving.

{% hint style="info" %}
Hooks without a **PRE** section cannot be selected for Backup Plan or Snapshot workflows.
{% endhint %}
