# Create Hook

## Create a Hook

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

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

<figure><img src="/files/9W8haoAweh0wuh5x2VOE" alt=""><figcaption></figcaption></figure>

The **Create Hook** dialog opens.

<figure><img src="/files/OnKyGII1M5kUTZZGCvBd" 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, T4K 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, T4K 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.trilio.io/kubernetes/user-guide/getting-started-with-management-console/navigating-intro/backup-and-recovery/hooks/create-hook.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
