# Scheduled jobs

## Your own schedule

Run one of your [functions](https://rezincore.com/docs/functions.md) on a timetable: on the function's settings choose "run by itself every … minutes", from 1 minute to a week.

```
rezin functions set tidy-up everyMinutes=60
```

- The function is called with `POST` and the body `{"type":"schedule","at":"…"}`, and `context.trigger` is `"schedule"`.
- A run that is missed while the service is restarting happens once when it is back, not once per missed slot.
- Each run is a line on the function's page, with how it ended and how long it took.

The timetable is an interval. Running at a set time of day, or on a calendar pattern, is not built.

## What the platform runs for every project

You do not set these up and cannot change them.

| Job | When | What it does |
|---|---|---|
| Backup | Nightly | A sealed copy of the database. The 14 most recent are kept. |
| Test restore | After the backup | The newest backup is restored into a scratch database to prove it can be |
| Audit check | Hourly | Confirms that the audit trail has not been altered |
| Session clean-up | Regularly | Removes sign-ins that have ended |
| Erase deleted projects | Hourly | Removes a deleted project for good once its 7 days have passed |
| Usage sizes | Daily | Notes each project's database and storage size for the Usage page |

A project's **Overview** page shows when the last backup ran and whether it restores.
