# Jobs

Part of the [Ownbox SDK reference](https://www.ownbox.io/sdk/reference.md).

## m.every

```python
m.every(seconds, *, name=None)
```

Run a function on a schedule.

Every `seconds`, from 15 to a week. Your Ownbox keeps the clock: the first run is due as soon as the machine starts, and a run that raises is reported while the next one goes ahead. Use it as a decorator. A button on the machine's page runs one of its jobs as if its time had come.

**Needs in machine.yaml:** Nothing

Example (where the machine is defined):

```python
@m.every(3600)
def check_quotes():
    m.save_setting("checked", int(m.setting("checked", default=0) or 0) + 1)
```

