> For the complete documentation index, see [llms.txt](https://docs.realmjoin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmjoin.com/pt/automatizacao/runbooks/scheduling.md).

# Agendamento de runbooks

Executar runbooks repetidamente ao longo do tempo

Alguns casos de utilização dos runbooks são mais adequados para serem executados repetidamente sem interação, como monitorizar o estado de um serviço ou verificar a capacidade restante de um armazenamento.

Nesses casos, pode atribuir um agendamento a um runbook e fazer com que o Azure o execute automaticamente por si no agendamento desejado.

O Portal RealmJoin permite-lhe atribuir agendamentos a runbooks, bem como gerir e criar agendamentos.

## Agendabilidade

Por predefinição, nem todos os runbooks estão assinalados como agendáveis. Isto serve para indicar facilmente quais os runbooks úteis para utilização agendada e quais os runbooks que, de preferência, devem ser usados de forma interativa.

Por predefinição, os runbooks com o sufixo `_scheduled` são assinalados como agendáveis. Pode substituir este comportamento usando [Permissões de runbook](https://docs.realmjoin.com/pt/automatizacao/runbooks/runbook-permissions.md).

## Atribuir agendamentos

Se um runbook estiver assinalado como agendável, o botão "Agendar" junto ao runbook ficará ativo.

<figure><img src="https://686519968-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FL54TwFjr1xMGZpGGtQtt%2Fimage.png?alt=media&amp;token=dc8fecc0-9b47-4e5e-bf20-e0121947427c" alt=""><figcaption><p>Runbook agendável vs. não agendável</p></figcaption></figure>

A caixa de diálogo de agendamento permite-lhe escolher um [agendamento ](#managing-schedules)e configurar os parâmetros de execução do runbook. Se os parâmetros forem deixados em branco, serão usados os valores predefinidos do runbook.

<figure><img src="https://686519968-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FAivwZ4D3LP6dggeUNgMn%2Fimage.png?alt=media&amp;token=f6481b90-be7b-4443-81fb-8ce5c107a3ec" alt=""><figcaption><p>Configurar um runbook agendado</p></figcaption></figure>

O Portal RealmJoin mostrará as atribuições de agendamento existentes ao navegar pelos runbooks.

<figure><img src="https://686519968-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FGGOotMi9lWdICfGz3uQV%2Fimage.png?alt=media&amp;token=20300526-0b7c-4794-8a13-2831a2a3f175" alt=""><figcaption><p>Runbook agendado</p></figcaption></figure>

## Gerir agendamentos

O Azure Automation permite aos administradores definir agendamentos personalizados para runbooks. Pode usar o Portal RealmJoin para gerir agendamentos existentes do Azure Automation ou criar novos.

Use a navegação à esquerda, selecionando os Registos de Runbook ![](https://686519968-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FiSjlSSR375ebVGEuZX3r%2Fjobs.png?alt=media\&token=92b3ba64-7c6e-46eb-b401-9304699d7943) e obteve os **Agendamentos** separador.

<figure><img src="https://686519968-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FWpUCzOSuVODK7Qb4OUyd%2Fimage.png?alt=media&amp;token=4dda4e68-9c45-4d38-a4b8-146c8db08384" alt=""><figcaption><p>Agendamentos de Runbook</p></figcaption></figure>

Pode adicionar um **Novo agendamento**, **Editar** ou **Eliminar** um agendamento existente a partir daqui.

### Agendamentos predefinidos

Se ainda não existirem agendamentos, o Portal RealmJoin oferecerá um **Criar agendamentos predefinidos** botão:

<figure><img src="https://686519968-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2F9kTPYJeQf3ERYN0PHVzk%2Fimage.png?alt=media&amp;token=251c4a66-40e5-4a02-aaee-3464b484d68f" alt=""><figcaption><p>Criar agendamentos</p></figcaption></figure>

Ao premir este botão, será criado um conjunto predefinido ("Horária", "Diária", "Semanal", "Mensal") de agendamentos, como mostrado acima.

### Novo / Editar agendamento

Ao criar ou editar um agendamento, pode modificar o nome, a descrição, a data/hora de início e de fim e a frequência.

A execução do runbook ocorrerá nos dias definidos pela data de início e pela frequência.

Por exemplo: Se configurar uma frequência semanal com um intervalo de 1 semana, começando na quinta-feira, 9 de março de 2023, então o runbook será executado todas as quintas-feiras, incluindo a de 9 de março e depois dessa data. Definir um intervalo de 2 semanas fará com que seja executado em 9 de março e apenas de duas em duas quintas-feiras depois disso, e assim por diante.

A hora de início define a que horas a execução ocorrerá. Definir o fuso horário garante que a hora seja interpretada em conformidade.

<figure><img src="https://686519968-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FikJ2G80BAtv82MSfOvZF%2Fimage.png?alt=media&amp;token=7fdbaf4d-545b-4916-9cfd-446c1009dff1" alt=""><figcaption><p>Editar agendamento</p></figcaption></figure>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.realmjoin.com/pt/automatizacao/runbooks/scheduling.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
