---
sidebar_position: 4
---

import {
  ConfigSection,
  Note,
  Important,
  Warning,
  ElementNavigator,
  SectionTitle,
  styles
} from '@site/src/components/documentation';

# Download Cleaner

The Download Cleaner automatically removes downloads from your download client after they have finished seeding according to configurable rules. This helps manage disk space and maintain optimal seeding ratios.

<ElementNavigator />

<div className={styles.documentationPage}>

<Important>
These settings need a download client to be configured.
</Important>

<div className={styles.section}>

<ConfigSection
  title="Enable Download Cleaner"
  icon="🔄"
>

When enabled, the Download Cleaner will run according to the configured schedule to automatically clean completed downloads from your download client.

</ConfigSection>

<ConfigSection
  title="Scheduling Mode"
  icon="📅"
>

Choose how to configure the Download Cleaner schedule:
- **Basic**: Simple interval-based scheduling (every X minutes/hours/seconds)
- **Advanced**: Full cron expression control for complex schedules

</ConfigSection>

<ConfigSection
  title="Cron Expression"
  icon="⏲️"
>

Enter a valid Quartz.NET cron expression to control when the Download Cleaner runs. The example above runs every hour.

**Common Cron Examples:**
- `0 0/5 * ? * * *` - Every 5 minutes
- `0 0 * ? * * *` - Every hour
- `0 0 */6 ? * * *` - Every 6 hours

</ConfigSection>

<ConfigSection
  title="Ignored Downloads"
  icon="🚫"
>

Downloads matching these patterns will be ignored by Download Cleaner. Patterns can match any of these:
- torrent hash
- qBittorrent tag or category
- Deluge label
- Transmission category (last directory from the save location)
- µTorrent label
- torrent tracker domain

**Examples:**
```
fa800a7d7c443a2c3561d1f8f393c089036dade1
tv-sonarr
qbit-tag
mytracker.com
```

</ConfigSection>

</div>

<div className={styles.section}>

<SectionTitle icon="🌱">Seeding Settings</SectionTitle>

<p className={styles.sectionDescription}>
  Settings that control how downloads are cleaned after they finish downloading.
</p>

<ConfigSection
  title="Delete Private Torrents"
  icon="🗑️"
>

When enabled, private torrents will be deleted from the download client when they meet the cleanup criteria. Use with caution as this permanently removes the download.

<Warning>
Setting this to true means private torrents will be permanently deleted, potentially affecting your private tracker account by receiving H&R if the seeding requirements are not met.
</Warning>

</ConfigSection>

</div>

<div className={styles.section}>

<SectionTitle icon="📏">Seeding Rules</SectionTitle>

<p className={styles.sectionDescription}>
  Categories define the cleanup rules for different types of downloads. Each category specifies when downloads should be removed based on ratio and time limits.
</p>

<Note>
A download is cleaned when both `Max Ratio` and `Min Seed Time` are reached, OR when `Max Seed Time` is reached regardless of ratio.
</Note>

<Important>
Both Max Ratio and Max Seed Time cannot be disabled (-1) at the same time. At least one cleanup condition must be configured.
</Important>

<ConfigSection
  title="Category Name"
  icon="🏷️"
>

The name of the download client category to apply these rules to. Must match the category name exactly as configured in your download client.

**Examples:**
- `tv-sonarr`
- `radarr`
- `lidarr`

</ConfigSection>

<ConfigSection
  title="Max Ratio"
  icon="📊"
>

Maximum ratio to seed before considering the download for removal. Set to `-1` to disable ratio-based cleanup.

</ConfigSection>

<ConfigSection
  title="Min Seed Time"
  icon="⏰"
>

Minimum time in hours to seed before removing a download that has reached the max ratio. Set to `0` to disable minimum time requirements.

</ConfigSection>

<ConfigSection
  title="Max Seed Time"
  icon="⏳"
>

Maximum time in hours to seed before removing a download regardless of ratio. Set to `-1` to disable time-based cleanup.

</ConfigSection>

<ConfigSection
  title="Delete Source Files"
  icon="🗑️"
>

When enabled, the source files will be deleted from disk when the download is removed from the download client. When disabled, only the torrent entry is removed while preserving the underlying files.

</ConfigSection>

</div>

<div className={styles.section}>

<SectionTitle icon="🔗">Unlinked Download Settings</SectionTitle>

<p className={styles.sectionDescription}>
  Settings for managing downloads that no longer have hardlinks to media files (indicating they may no longer be needed by the *arr applications).
</p>

<ConfigSection
  title="Enable Unlinked Download Handling"
  icon="🔍"
>

Enable management of downloads that have no hardlinks remaining. This helps identify downloads that are no longer needed by your *arr applications.

<Important>
If you are using Docker, make sure to mount the downloads directory the same way it is mounted for the download client. If your download client's download directory is `/downloads`, it should be the same for Cleanuparr.
</Important>

</ConfigSection>

<ConfigSection
  title="Target Category"
  icon="🎯"
>

Category to move unlinked downloads to.

</ConfigSection>

<ConfigSection
  title="Use Tag"
  icon="🏷️"
>

When enabled, uses a tag instead of category for marking unlinked downloads (qBittorrent only).

</ConfigSection>

<ConfigSection
  title="Ignored Root Directory"
  icon="📁"
>

Root directory to ignore when checking for unlinked downloads. Useful for cross-seed setups where you want to ignore hardlinks (even though a movie is not in Radarr anymore, it can have hardlinks from cross-seed).

```
/data
├── downloads
│   ├── torrents
│   └── cross-seed
├── movies
└── shows
```

For the example above, the ignored root directory should be set to `/data/downloads`.

</ConfigSection>

<ConfigSection
  title="Unlinked Categories"
  icon="📋"
>

Categories to check for unlinked downloads. Only downloads in these categories will be checked for missing hardlinks.

</ConfigSection>

</div>

</div>