PHPackages                             magicalex/rtorrent-cleaner - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. magicalex/rtorrent-cleaner

ActiveProject[CLI &amp; Console](/categories/cli)

magicalex/rtorrent-cleaner
==========================

rtorrent-cleaner is a tool to clean up unnecessary files in rtorrent

0.9.8(5y ago)481424MITPHPPHP &gt;=5.5.9

Since Nov 26Pushed 5y ago5 watchersCompare

[ Source](https://github.com/Magicalex/rtorrent-cleaner)[ Packagist](https://packagist.org/packages/magicalex/rtorrent-cleaner)[ Fund](https://paypal.me/AlexandreLevionnais)[ RSS](/packages/magicalex-rtorrent-cleaner/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (3)Versions (35)Used By (0)

rtorrent-cleaner
================

[](#rtorrent-cleaner)

rtorrent-cleaner is a tool to clean up unnecessary files in rtorrent

[![styleci](https://camo.githubusercontent.com/ad49ce3f05cf070e7136ad61f4c9649680a3872ba669c6b8576eee52cfc6298d/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3135383735303730342f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/158750704)[![stable](https://camo.githubusercontent.com/d05ed0211d9e9cbf6761782bd84a78bc2d37db39f39c43e24aaa00d1e7bb86d3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61676963616c65782f72746f7272656e742d636c65616e65723f636f6c6f723d677265656e267374796c653d666c61742d737175617265)](https://packagist.org/packages/magicalex/rtorrent-cleaner)[![GitHub All Releases](https://camo.githubusercontent.com/6a9b41c1a0f30dcdbecf6971efc7caf31b6514d1a87bf8bf0b6d651c30273173/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f6d61676963616c65782f72746f7272656e742d636c65616e65722f746f74616c3f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/6a9b41c1a0f30dcdbecf6971efc7caf31b6514d1a87bf8bf0b6d651c30273173/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f6d61676963616c65782f72746f7272656e742d636c65616e65722f746f74616c3f7374796c653d666c61742d737175617265)

[![](https://github.com/magicalex/rtorrent-cleaner/workflows/build/badge.svg)](https://github.com/Magicalex/rtorrent-cleaner/actions)[![](https://camo.githubusercontent.com/2dfb4c595c58088b540fa7ebe7c9b4d85d28849937235ca5e3476df3eba622b8/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f70756c6c732f6d61676963616c65782f72746f7272656e742d636c65616e6572)](https://hub.docker.com/r/magicalex/rtorrent-cleaner)[![](https://camo.githubusercontent.com/d397cbc07ba8d71fc34c9dc11ce0edbe1632e865b712ca9c37e259c65b12d6a9/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f73746172732f6d61676963616c65782f72746f7272656e742d636c65616e6572)](https://hub.docker.com/r/magicalex/rtorrent-cleaner)

Requirements
------------

[](#requirements)

- php 5.5.9 and above (php 7.2 recommended)
- php extension: `php-cli`, `php-xmlrpc` and `php-mbstring`

Installation
------------

[](#installation)

### Install rtorrent-cleaner from phar file (recommended)

[](#install-rtorrent-cleaner-from-phar-file-recommended)

The preferred method of installation is to use the rtorrent-cleaner PHAR which can be downloaded from the most recent
[Check GitHub Release](https://github.com/Magicalex/rtorrent-cleaner/releases).

### Install rtorrent-cleaner from composer

[](#install-rtorrent-cleaner-from-composer)

Install rtorrent-cleaner in global

```
composer global require magicalex/rtorrent-cleaner
```

### Install rtorrent-cleaner from DockerHub

[](#install-rtorrent-cleaner-from-dockerhub)

#### Requirements

[](#requirements-1)

- docker [install docker](https://docs.docker.com/install)

```
docker run -it --rm magicalex/rtorrent-cleaner:latest
```

See the details [here](https://github.com/Magicalex/rtorrent-cleaner#usage-with-docker)

Usage
-----

[](#usage)

Displaying help:

```
      _                            _          _
 _ __| |_ ___  _ __ _ __ ___ _ __ | |_    ___| | ___  __ _ _ __   ___ _ __
| '__| __/ _ \| '__| '__/ _ \ '_ \| __|  / __| |/ _ \/ _` | '_ \ / _ \ '__|
| |  | || (_) | |  | | |  __/ | | | |_  | (__| |  __/ (_| | | | |  __/ |
|_|   \__\___/|_|  |_|  \___|_| |_|\__|  \___|_|\___|\__,_|_| |_|\___|_|
rtorrent-cleaner version x.x.x

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  debug     Debug torrents
  help      Displays help for a command
  list      Lists commands
  mv        Move your unnecessary files in a specified folder
  report    Create a report on unnecessary files and missing files
  rm        Delete your unnecessary files in your download folder
  torrents  Delete torrents or redownload the missing files
```

Command `report` for create a report on unnecessary files and missing files:
(Configuration in your rtorrent.rc ex: `network.scgi.open_port = localhost:5000`)

```
rtorrent-cleaner report localhost:5000
```

Example with a socket (file rtorrent.rc `network.scgi.open_local = /home/user/rpc.socket`)

```
rtorrent-cleaner report /home/user/rpc.socket
```

You can log the console output in a file with the option --log (path: ./rtorrent-cleaner.log)
You can define a path (path: /var/log/rtorrent-cleaner.log)

```
rtorrent-cleaner report --log -- 127.0.0.1:5000
rtorrent-cleaner report -l /var/log/rtorrent-cleaner.log 127.0.0.1:5000
rtorrent-cleaner report --log=/var/log/rtorrent-cleaner.log 127.0.0.1:5000
```

Command `rm` for delete unnecessary files in your download folder:

```
rtorrent-cleaner rm 127.0.0.1:5000
# delete without confirmation --assume-yes or -y
rtorrent-cleaner rm --assume-yes 127.0.0.1:5000
```

Command `mv` for move unnecessary files in a specified folder (ex: /home/user/old) :

```
rtorrent-cleaner mv 127.0.0.1:5000 /home/user/old
# move without confirmation --assume-yes or -y
rtorrent-cleaner mv -y 127.0.0.1:5000 /home/user/old
```

Command `torrents` for delete torrents or redownload the missing files:

```
rtorrent-cleaner torrents 127.0.0.1:5000
```

Option for the command `mv`, `rm` and `report` to ignore files: `--exclude-files=`

```
rtorrent-cleaner report --exclude-files=*.srt 127.0.0.1:5000
rtorrent-cleaner report -f *.sub -f *.srt 127.0.0.1:5000
```

The second example excludes all files `.sub` and `.srt` in the output

Option for the command `mv`, `rm` and `report` to ignore directories: `--exclude-dirs=`
The directories must be relative to directory default of rtorrent (`directory.default` in rtorrent.rc)

```
rtorrent-cleaner report --exclude-dirs=movies 127.0.0.1:5000
rtorrent-cleaner report -d movies -d series 127.0.0.1:5000
```

The second example excludes the `movies` and `series` directories

Usage with docker
-----------------

[](#usage-with-docker)

### Environment variables

[](#environment-variables)

VariableDescriptionTypeDefault value**PHP\_MEMORY\_LIMIT**Memory limit directive of php*optional*128M**PHP\_TIMEZONE**Timezone directive of php*optional*UTCInfo: change `` by the name of your container of rtorrent
Info: change `` by your downloads folder
Info: change `` by `directory.default` of rtorrent. See your file rtorrent.rc

Command for displaying help: `rtorrent-cleaner`

```
docker run -it --rm \
  -v : \
  --link :rtorrent \
  magicalex/rtorrent-cleaner
```

If you use your container with a network you can connect rtorrent-cleaner like this:
Info: change `` by your network (you can list all the docker networks `docker network ls`)

```
docker run -it --rm \
  -v : \
  --network  \
  --link :rtorrent \
  magicalex/rtorrent-cleaner
```

Command for making a report: `rtorrent-cleaner report rtorrent:5000`

```
docker run -it --rm \
  -v : \
  --network  \
  --link :rtorrent \
  magicalex/rtorrent-cleaner report rtorrent:5000
```

You can increase php memory limit if needed with PHP\_MEMORY\_LIMIT environment variable.
By default, the memory limit is 128M.

```
docker run -it --rm \
  -e PHP_MEMORY_LIMIT=256M \
  -v : \
  --network  \
  --link :rtorrent \
  magicalex/rtorrent-cleaner
```

You can change the timezone with PHP\_TIMEZONE environment variable.
By default, the timezone is UTC.

```
docker run -it --rm \
  -e PHP_TIMEZONE=Europe/Paris \
  -v : \
  --network  \
  --link :rtorrent \
  magicalex/rtorrent-cleaner
```

You can create a script for run rtorrent-cleaner with Docker

```
#!/usr/bin/env sh

docker run -it --rm \
  -v : \
  --network  \
  --link :rtorrent \
  magicalex/rtorrent-cleaner $*
```

Or if you use a socket with rtorrent `/run/php/.rtorrent.sock`.

```
#!/usr/bin/env sh

docker run -it --rm \
  -v : \
  -v /run/php:/run/php \
  magicalex/rtorrent-cleaner $*
```

```
chmod +x /usr/local/bin/rtorrent-cleaner
```

Usage:

```
rtorrent-cleaner report rtorrent:5000
rtorrent-cleaner rm rtorrent:5000
rtorrent-cleaner torrents rtorrent:5000
rtorrent-cleaner mv rtorrent:5000 /home/user/old

```

Or with a socket

```
rtorrent-cleaner report /run/php/.rtorrent.sock
rtorrent-cleaner rm /run/php/.rtorrent.sock
rtorrent-cleaner torrents /run/php/.rtorrent.sock
rtorrent-cleaner mv /run/php/.rtorrent.sock /home/user/old

```

### Example with the docker image [linuxserver/rutorrent](https://hub.docker.com/r/linuxserver/rutorrent)

[](#example-with-the-docker-image-linuxserverrutorrent)

Configure your `docker-compose.yml`

```
version: "3"

services:
  rutorrent:
    image: linuxserver/rutorrent:latest
    container_name: rutorrent
    environment:
      - PUID=1000
      - PGID=1000
    volumes:
      - /path/to/rutorrent/config:/config
      - /path/to/rutorrent/downloads:/downloads
      - /run/php:/run/php
    ports:
      - 80:80
      - 51413:51413
      - 6881:6881/udp
    restart: unless-stopped
```

Run linuxserver/rutorrent

```
docker-compose up -d
```

Create your rtorrent-cleaner script in `/usr/local/bin` folder

```
#!/usr/bin/env sh

docker run -it --rm \
  -e PHP_MEMORY_LIMIT=128M \
  -e PHP_TIMEZONE=Europe/Paris \
  -v /path/to/rutorrent/downloads:/downloads \
  -v /run/php:/run/php \
  magicalex/rtorrent-cleaner $*
```

After this step you can run rtorrent-cleaner

```
chmod +x /usr/local/bin/rtorrent-cleaner
rtorrent-cleaner report /run/php/.rtorrent.sock
```

Build docker image
------------------

[](#build-docker-image)

```
docker build -t magicalex/rtorrent-cleaner:latest https://github.com/Magicalex/rtorrent-cleaner.git
```

Build Phar Archive (rtorrent-cleaner.phar)
------------------------------------------

[](#build-phar-archive-rtorrent-cleanerphar)

To build the archive phar, php 7.2 and `php-phar` extension is required.

```
git clone https://github.com/Magicalex/rtorrent-cleaner.git
cd rtorrent-cleaner
composer build
```

License
-------

[](#license)

rtorrent-cleaner is released under the [MIT License](https://github.com/Magicalex/rtorrent-cleaner/blob/master/LICENSE).

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~16 days

Recently: every ~54 days

Total

34

Last Release

2169d ago

PHP version history (3 changes)0.1.0PHP &gt;=7.0.0

0.2.1PHP &gt;=5.6.0

0.9.7PHP &gt;=5.5.9

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/201665909?v=4)[Magicalex](/maintainers/Magicalex)[@MagicAlex](https://github.com/MagicAlex)

---

Tags

cleancleanercomposerconsolepharphprtorrentrutorrentconsolepharfilecleanrtorrentcleanerrutorrent

### Embed Badge

![Health badge](/badges/magicalex-rtorrent-cleaner/health.svg)

```
[![Health](https://phpackages.com/badges/magicalex-rtorrent-cleaner/health.svg)](https://phpackages.com/packages/magicalex-rtorrent-cleaner)
```

###  Alternatives

[psy/psysh

An interactive shell for modern PHP.

9.8k545.6M719](/packages/psy-psysh)[nunomaduro/phpinsights

Instant PHP quality checks from your console.

5.6k10.8M426](/packages/nunomaduro-phpinsights)[humbug/box

Fast, zero config application bundler with PHARs.

1.3k801.5k69](/packages/humbug-box)[drupal/console-core

Drupal Console Core

13514.7M12](/packages/drupal-console-core)[matthiasnoback/symfony-console-form

Use Symfony forms for Console command input

368264.8k8](/packages/matthiasnoback-symfony-console-form)[laminas/laminas-cli

Command-line interface for Laminas projects

563.7M54](/packages/laminas-laminas-cli)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
