# Housekeeping

> One dispatcher for the recurring cleanups the installed blocks contribute (purges, expiries): maintenance() runs each due job and records its outcome, and maintenance_schedule() registers it with pg_cron.

- Category: Automation
- Module: `housekeeping`
- Modes: `managed`
- Docs: https://bettersupabase.com/docs/blocks/sql
- Page: https://bettersupabase.com/blocks/housekeeping

## Install

```bash
npx better-supabase add housekeeping
```

## Configure

Add the block to `better-supabase.config.ts`:

```ts
import { defineConfig } from "better-supabase/config";

export default defineConfig({
  blocks: {
    // Modes: "managed". The default is "managed".
    housekeeping: { mode: "managed" },
  },
});
```

## Client

The block is SQL only: call its functions from your policies, RPCs and the other modules.
