Shrink your qBittorrent downloads folder by magnitudes.
Shrinkarr is a support tool for the *Arr stack, that can automatically delete torrents by size or completion date once a given free space threshold has been reached. Users can limit the categories that Shrinkarr is allowed to remove.
Tools such as Prunerr already exist to only remove torrents that have been upgraded in the *Arr apps. However, sometimes the *Arr apps and download client don't share the same disk, in which case you might want a simpler approach of deleting items once a certain free space threshold has been reached.
Shrinkarr can be run with Python, or as a Docker container.
Simply run the script once with Python, at least 3.10 is required:
# Install dependencies, only needed once
$ python3 -m pip install -r requirements.txt
# Run Shrinkarr
$ python3 -m shrinkarr.main
A .env
file must be present at the current location, or mandatory environment variables must be set. For more see Configuration.
The Docker container can manage its own CRON job running every five minutes if you want to. In which case set the --entrypoint
to cron
:
$ docker run shrinkarr:latest --entrypoint 'cron'
If you don't want the job to run every five minutes, just run the Docker container. This can be useful for managing your own scheduler e.g. with Kubernetes CronJob
:
$ docker run shrinkarr:latest
Shrinkarr supports the following environment variables to configure its behavior.
General qBittorrent settings to connect with download client.
The host of your qBittorrent instance. Must include http(s).
qBittorrent username.
Default: admin
qBittorrent password.
Default: admin
You can configure the path that Shrinkarr should monitor, since usually it will be running in Docker with a mounted volume.
Shrinkarr monitoring path. Should be absolute.
Examples: /mnt/media
You can either configure the absolute free space or a ratio of the monitored path's size that Shrinkarr will use as the threshold to start deleting downloads.
Free space below which Shrinkarr will delete downloads.
Examples: 20GB
, 2TB
Ratio of the drive's total size below which Shrinkarr will delete downloads.
Examples: 0.2
Minimum size of files that can be deleted.
Examples: 20GB
, 2TB
Delete torrents by completed on (oldest to newest).
Examples: true
Delete torrents by size (largest to smallest).
Examples: true
Categories for torrents that can be deleted.
Examples: radarr,tv-sonarr