> ## Documentation Index
> Fetch the complete documentation index at: https://docs.infraudit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage InfraAudit's scheduled scans and jobs

> View and manage InfraAudit's scheduled background jobs: resource sync, drift detection, vulnerability scanning, cost sync, and compliance checks.

InfraAudit runs background jobs on a cron schedule to keep your infrastructure data current without manual intervention. The **Jobs** section lets you view job history, trigger manual runs, and — for self-hosted deployments — adjust schedules.

## Job types

| Job type             | What it does                                           | Default schedule   |
| -------------------- | ------------------------------------------------------ | ------------------ |
| `resource_sync`      | Pulls the latest resource inventory from all providers | Every 6 hours      |
| `drift_detection`    | Compares current resource state to baselines           | Every 4 hours      |
| `vulnerability_scan` | Runs Trivy against scannable artifacts                 | Daily at 02:00 UTC |
| `cost_sync`          | Fetches billing data from provider APIs                | Daily at 03:00 UTC |
| `compliance_check`   | Runs all enabled compliance frameworks                 | Daily at 04:00 UTC |

## Job list

In the sidebar, click **Jobs**. The list shows all defined jobs with:

* The job type and name
* Next scheduled run time
* Status of the last execution (succeeded, failed, or running)

Click a job to expand its execution history — a timeline of past runs with start time, duration, status, and a log excerpt.

## Triggering a manual run

Click **Run now** on any job in the UI, or trigger one from the CLI:

```bash theme={null}
# List all jobs
infraudit job list

# Trigger a manual run
infraudit job trigger <job-id>

# Trigger and wait for completion
infraudit job trigger <job-id> --wait
```

## Job execution detail

Click any past execution to see:

* Start and end timestamps
* Duration
* Status (`running`, `succeeded`, or `failed`)
* Log output (last 500 lines)
* Resources or findings affected by the run

## Modifying schedules (self-hosted)

For self-hosted deployments, schedules are configured via environment variables. Edit `.env` and restart the API:

```env theme={null}
JOB_RESOURCE_SYNC_SCHEDULE=0 */6 * * *
JOB_DRIFT_DETECTION_SCHEDULE=0 */4 * * *
JOB_VULNERABILITY_SCAN_SCHEDULE=0 2 * * *
JOB_COST_SYNC_SCHEDULE=0 3 * * *
JOB_COMPLIANCE_CHECK_SCHEDULE=0 4 * * *
```

These use standard cron syntax (minute, hour, day-of-month, month, day-of-week). The scheduler supports an optional seconds prefix if you need sub-minute precision.

<Note>
  On SaaS, job schedules are not user-configurable. Contact support if you need a non-standard schedule for your plan.
</Note>

## Disabling a job

There's no disable toggle in the UI. To stop a job from running on self-hosted deployments, remove or comment out its `SCHEDULE` environment variable and restart the API. Alternatively:

```bash theme={null}
infraudit job disable <job-id>
```

## Notifications on job failure

When a job fails, InfraAudit creates an alert in the Alerts section. To also receive a Slack notification when a job fails, add a routing rule for the `job.failed` event type under **Settings → Notifications → Routing**.

## Next steps

* [Drift detection](/platform/drift-detection) — what the drift detection job finds
* [Vulnerabilities](/platform/vulnerabilities) — how vulnerability scan results work
* [Compliance](/platform/compliance) — what the compliance check job assesses
