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

# Automatic file cleanup

> Configure automatic deletion of uploaded files in Reducto

## Overview

When `FILE_CLEANUP_ENABLED` is set, Reducto records the keys of every object written to customer storage and automatically deletes any object that is older than the configured retention window (default 60 minutes). The cleanup runs as part of the hourly `cleanup.py` cronjob. **Note:** Because cleanup is performed hourly, the minimum effective retention interval is 60 minutes (1 hour).

## Configuration

| Variable                 | Description                                                                                                                      | Default |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `FILE_CLEANUP_ENABLED`   | Set to any value to enable automatic deletion of stored objects.                                                                 | –       |
| `FILE_RETENTION_MINUTES` | Retention window in minutes before an object is permanently removed. The minimum is 60 minutes (1 hour), as cleanup runs hourly. | `60`    |

Example:

```bash theme={null}
export FILE_CLEANUP_ENABLED=1
export FILE_RETENTION_MINUTES=120  # keep files for two hours
```
