---
sidebar_position: 4
---

import { Note, Important, Warning } from '@site/src/components/Admonition';
import { 
  ConfigSection, 
  EnhancedNote, 
  EnhancedImportant, 
  EnhancedWarning,
  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.

<div className={styles.documentationPage}>

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

<div className={styles.section}>

<ConfigSection
  id="enable-download-cleaner"
  title="Enable Download Cleaner"
  description="When enabled, the Download Cleaner will run according to the configured schedule to automatically clean completed downloads from your download client."
  icon="🔄"
>

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

</ConfigSection>

<ConfigSection
  id="scheduling-mode"
  title="Scheduling Mode"
  description="Choose how to configure the Download Cleaner schedule"
  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
  id="cron-expression"
  title="Cron Expression"
  description="Enter a valid Quartz.NET cron expression to control when the Download Cleaner runs"
  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>

</div>

<div className={styles.section}>

<h2 className={styles.sectionTitle}>
  <span className={styles.sectionIcon}>🌱</span>
  Seeding Settings
</h2>

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

<ConfigSection
  id="delete-private-torrents"
  title="Delete Private Torrents"
  description="When enabled, private torrents will be deleted from the download client when they meet the cleanup criteria"
  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.

<EnhancedWarning>
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.
</EnhancedWarning>

</ConfigSection>

</div>

<div className={styles.section}>

<h2 className={styles.sectionTitle}>
  <span className={styles.sectionIcon}>📏</span>
  Seeding Rules
</h2>

<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>

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

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

<ConfigSection
  id="category-name"
  title="Category Name"
  description="The name of the download client category to apply these rules to"
  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
  id="max-ratio"
  title="Max Ratio"
  description="Maximum ratio to seed before considering the download for removal"
  icon="📊"
>

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

</ConfigSection>

<ConfigSection
  id="min-seed-time"
  title="Min Seed Time (hours)"
  description="Minimum time in hours to seed before removing a download that has reached the max ratio"
  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
  id="max-seed-time"
  title="Max Seed Time (hours)"
  description="Maximum time in hours to seed before removing a download regardless of ratio"
  icon="⏳"
>

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

</ConfigSection>

</div>

<div className={styles.section}>

<h2 className={styles.sectionTitle}>
  <span className={styles.sectionIcon}>🔗</span>
  Unlinked Download Settings
</h2>

<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
  id="enable-unlinked-download-handling"
  title="Enable Unlinked Download Handling"
  description="Enable management of downloads that have no hardlinks remaining"
  icon="🔍"
>

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

<EnhancedImportant>
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.
</EnhancedImportant>

</ConfigSection>

<ConfigSection
  id="target-category"
  title="Target Category"
  description="Category to move unlinked downloads to"
  icon="🎯"
>

Category to move unlinked downloads to.

</ConfigSection>

<ConfigSection
  id="use-tag"
  title="Use Tag"
  description="When enabled, uses a tag instead of category for marking unlinked downloads (qBittorrent only)"
  icon="🏷️"
>

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

</ConfigSection>

<ConfigSection
  id="ignored-root-directory"
  title="Ignored Root Directory"
  description="Root directory to ignore when checking for unlinked downloads"
  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
  id="unlinked-categories"
  title="Unlinked Categories"
  description="Categories to check for unlinked downloads"
  icon="📋"
>

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

</ConfigSection>

</div>

</div>