> For the complete documentation index, see [llms.txt](https://docs.trilio.io/kubernetes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trilio.io/kubernetes/user-guide/getting-started-with-management-console/navigating-intro/backup-and-recovery/hooks/create-hook.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` 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>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
