{"id":21272692,"url":"https://github.com/al3xLvs/rtorrent-cleaner","last_synced_at":"2025-07-11T06:32:20.967Z","repository":{"id":62522469,"uuid":"158750704","full_name":"al3xLvs/rtorrent-cleaner","owner":"al3xLvs","description":"🧹 rtorrent-cleaner is a tool to clean up unnecessary files in rtorrent","archived":false,"fork":false,"pushed_at":"2020-11-18T01:12:08.000Z","size":1591,"stargazers_count":50,"open_issues_count":0,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-17T06:18:29.411Z","etag":null,"topics":["clean","cleaner","composer","console","phar","php","rtorrent","rutorrent"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/al3xLvs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":["https://paypal.me/AlexandreLevionnais"]}},"created_at":"2018-11-22T21:15:16.000Z","updated_at":"2024-08-31T16:26:20.000Z","dependencies_parsed_at":"2022-11-02T14:46:29.404Z","dependency_job_id":null,"html_url":"https://github.com/al3xLvs/rtorrent-cleaner","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al3xLvs%2Frtorrent-cleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al3xLvs%2Frtorrent-cleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al3xLvs%2Frtorrent-cleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al3xLvs%2Frtorrent-cleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/al3xLvs","download_url":"https://codeload.github.com/al3xLvs/rtorrent-cleaner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225700958,"owners_count":17510448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clean","cleaner","composer","console","phar","php","rtorrent","rutorrent"],"created_at":"2024-11-21T09:02:13.009Z","updated_at":"2024-11-21T09:02:15.104Z","avatar_url":"https://github.com/al3xLvs.png","language":"PHP","funding_links":["https://paypal.me/AlexandreLevionnais"],"categories":["PHP"],"sub_categories":[],"readme":"# rtorrent-cleaner\n\nrtorrent-cleaner is a tool to clean up unnecessary files in rtorrent\n\n[![styleci](https://github.styleci.io/repos/158750704/shield?branch=master)](https://github.styleci.io/repos/158750704)\n[![stable](https://img.shields.io/packagist/v/magicalex/rtorrent-cleaner?color=green\u0026style=flat-square)](https://packagist.org/packages/magicalex/rtorrent-cleaner)\n![GitHub All Releases](https://img.shields.io/github/downloads/magicalex/rtorrent-cleaner/total?style=flat-square)\n\n[![](https://github.com/magicalex/rtorrent-cleaner/workflows/build/badge.svg)](https://github.com/Magicalex/rtorrent-cleaner/actions)\n[![](https://img.shields.io/docker/pulls/magicalex/rtorrent-cleaner)](https://hub.docker.com/r/magicalex/rtorrent-cleaner)\n[![](https://img.shields.io/docker/stars/magicalex/rtorrent-cleaner)](https://hub.docker.com/r/magicalex/rtorrent-cleaner)\n\n## Requirements\n\n- php 5.5.9 and above (php 7.2 recommended)\n- php extension: `php-cli`, `php-xmlrpc` and `php-mbstring`\n\n## Installation\n\n### Install rtorrent-cleaner from phar file (recommended)\n\nThe preferred method of installation is to use the rtorrent-cleaner PHAR which can be downloaded from the most recent  \n[Check GitHub Release](https://github.com/Magicalex/rtorrent-cleaner/releases).\n\n### Install rtorrent-cleaner from composer\n\nInstall rtorrent-cleaner in global\n\n```sh\ncomposer global require magicalex/rtorrent-cleaner\n```\n\n### Install rtorrent-cleaner from DockerHub\n\n#### Requirements\n\n- docker [install docker](https://docs.docker.com/install)\n\n```sh\ndocker run -it --rm magicalex/rtorrent-cleaner:latest\n```\n\nSee the details [here](https://github.com/Magicalex/rtorrent-cleaner#usage-with-docker)\n\n## Usage\n\nDisplaying help:\n\n```sh\n      _                            _          _\n _ __| |_ ___  _ __ _ __ ___ _ __ | |_    ___| | ___  __ _ _ __   ___ _ __\n| '__| __/ _ \\| '__| '__/ _ \\ '_ \\| __|  / __| |/ _ \\/ _` | '_ \\ / _ \\ '__|\n| |  | || (_) | |  | | |  __/ | | | |_  | (__| |  __/ (_| | | | |  __/ |\n|_|   \\__\\___/|_|  |_|  \\___|_| |_|\\__|  \\___|_|\\___|\\__,_|_| |_|\\___|_|\nrtorrent-cleaner version x.x.x\n\nUsage:\n  command [options] [arguments]\n\nOptions:\n  -h, --help            Display this help message\n  -q, --quiet           Do not output any message\n  -V, --version         Display this application version\n      --ansi            Force ANSI output\n      --no-ansi         Disable ANSI output\n  -n, --no-interaction  Do not ask any interactive question\n  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug\n\nAvailable commands:\n  debug     Debug torrents\n  help      Displays help for a command\n  list      Lists commands\n  mv        Move your unnecessary files in a specified folder\n  report    Create a report on unnecessary files and missing files\n  rm        Delete your unnecessary files in your download folder\n  torrents  Delete torrents or redownload the missing files\n```\n\nCommand `report` for create a report on unnecessary files and missing files:  \n(Configuration in your rtorrent.rc ex: `network.scgi.open_port = localhost:5000`)\n\n```sh\nrtorrent-cleaner report localhost:5000\n```\n\nExample with a socket (file rtorrent.rc `network.scgi.open_local = /home/user/rpc.socket`)\n\n```sh\nrtorrent-cleaner report /home/user/rpc.socket\n```\n\nYou can log the console output in a file with the option --log (path: ./rtorrent-cleaner.log)  \nYou can define a path (path: /var/log/rtorrent-cleaner.log)\n\n```sh\nrtorrent-cleaner report --log -- 127.0.0.1:5000\nrtorrent-cleaner report -l /var/log/rtorrent-cleaner.log 127.0.0.1:5000\nrtorrent-cleaner report --log=/var/log/rtorrent-cleaner.log 127.0.0.1:5000\n```\n\nCommand `rm` for delete unnecessary files in your download folder:\n\n```sh\nrtorrent-cleaner rm 127.0.0.1:5000\n# delete without confirmation --assume-yes or -y\nrtorrent-cleaner rm --assume-yes 127.0.0.1:5000\n```\n\nCommand `mv` for move unnecessary files in a specified folder (ex: /home/user/old) :\n\n```sh\nrtorrent-cleaner mv 127.0.0.1:5000 /home/user/old\n# move without confirmation --assume-yes or -y\nrtorrent-cleaner mv -y 127.0.0.1:5000 /home/user/old\n```\n\nCommand `torrents` for delete torrents or redownload the missing files:\n\n```sh\nrtorrent-cleaner torrents 127.0.0.1:5000\n```\n\nOption for the command `mv`, `rm` and `report` to ignore files: `--exclude-files=`\n\n```sh\nrtorrent-cleaner report --exclude-files=*.srt 127.0.0.1:5000\nrtorrent-cleaner report -f *.sub -f *.srt 127.0.0.1:5000\n```\n\nThe second example excludes all files `.sub` and `.srt` in the output\n\nOption for the command `mv`, `rm` and `report` to ignore directories: `--exclude-dirs=`  \nThe directories must be relative to directory default of rtorrent (`directory.default` in rtorrent.rc)\n\n```sh\nrtorrent-cleaner report --exclude-dirs=movies 127.0.0.1:5000\nrtorrent-cleaner report -d movies -d series 127.0.0.1:5000\n```\n\nThe second example excludes the `movies` and `series` directories\n\n## Usage with docker\n\n### Environment variables\n\n| Variable | Description | Type | Default value |\n| -------- | ----------- | ---- | ------------- |\n| **PHP_MEMORY_LIMIT** | Memory limit directive of php | *optional* | 128M\n| **PHP_TIMEZONE** | Timezone directive of php | *optional* | UTC\n\nInfo: change `\u003ccontainer_name\u003e` by the name of your container of rtorrent  \nInfo: change `\u003c/home/user/downloads\u003e` by your downloads folder  \nInfo: change `\u003c/data/downloads\u003e` by `directory.default` of rtorrent. See your file rtorrent.rc\n\nCommand for displaying help: `rtorrent-cleaner`\n\n```sh\ndocker run -it --rm \\\n  -v \u003c/home/user/downloads\u003e:\u003c/data/downloads\u003e \\\n  --link \u003ccontainer_name\u003e:rtorrent \\\n  magicalex/rtorrent-cleaner\n```\n\nIf you use your container with a network you can connect rtorrent-cleaner like this:  \nInfo: change `\u003cnetwork_name\u003e` by your network (you can list all the docker networks `docker network ls`)\n\n```sh\ndocker run -it --rm \\\n  -v \u003c/home/user/downloads\u003e:\u003c/data/downloads\u003e \\\n  --network \u003cnetwork_name\u003e \\\n  --link \u003ccontainer_name\u003e:rtorrent \\\n  magicalex/rtorrent-cleaner\n```\n\nCommand for making a report: `rtorrent-cleaner report rtorrent:5000`\n\n```sh\ndocker run -it --rm \\\n  -v \u003c/home/user/downloads\u003e:\u003c/data/downloads\u003e \\\n  --network \u003cnetwork_name\u003e \\\n  --link \u003ccontainer_name\u003e:rtorrent \\\n  magicalex/rtorrent-cleaner report rtorrent:5000\n```\n\nYou can increase php memory limit if needed with PHP_MEMORY_LIMIT environment variable.  \nBy default, the memory limit is 128M.\n\n```sh\ndocker run -it --rm \\\n  -e PHP_MEMORY_LIMIT=256M \\\n  -v \u003c/home/user/downloads\u003e:\u003c/data/downloads\u003e \\\n  --network \u003cnetwork_name\u003e \\\n  --link \u003ccontainer_name\u003e:rtorrent \\\n  magicalex/rtorrent-cleaner\n```\n\nYou can change the timezone with PHP_TIMEZONE environment variable.  \nBy default, the timezone is UTC.\n\n```sh\ndocker run -it --rm \\\n  -e PHP_TIMEZONE=Europe/Paris \\\n  -v \u003c/home/user/downloads\u003e:\u003c/data/downloads\u003e \\\n  --network \u003cnetwork_name\u003e \\\n  --link \u003ccontainer_name\u003e:rtorrent \\\n  magicalex/rtorrent-cleaner\n```\n\nYou can create a script for run rtorrent-cleaner with Docker\n\n```sh\n#!/usr/bin/env sh\n\ndocker run -it --rm \\\n  -v \u003c/home/user/downloads\u003e:\u003c/data/downloads\u003e \\\n  --network \u003cnetwork_name\u003e \\\n  --link \u003ccontainer_name\u003e:rtorrent \\\n  magicalex/rtorrent-cleaner $*\n```\n\nOr if you use a socket with rtorrent `/run/php/.rtorrent.sock`.\n\n```sh\n#!/usr/bin/env sh\n\ndocker run -it --rm \\\n  -v \u003c/home/user/downloads\u003e:\u003c/data/downloads\u003e \\\n  -v /run/php:/run/php \\\n  magicalex/rtorrent-cleaner $*\n```\n\n```sh\nchmod +x /usr/local/bin/rtorrent-cleaner\n```\n\nUsage:\n\n```\nrtorrent-cleaner report rtorrent:5000\nrtorrent-cleaner rm rtorrent:5000\nrtorrent-cleaner torrents rtorrent:5000\nrtorrent-cleaner mv rtorrent:5000 /home/user/old\n```\n\nOr with a socket\n\n```\nrtorrent-cleaner report /run/php/.rtorrent.sock\nrtorrent-cleaner rm /run/php/.rtorrent.sock\nrtorrent-cleaner torrents /run/php/.rtorrent.sock\nrtorrent-cleaner mv /run/php/.rtorrent.sock /home/user/old\n```\n\n### Example with the docker image [linuxserver/rutorrent](https://hub.docker.com/r/linuxserver/rutorrent)\n\nConfigure your `docker-compose.yml`\n\n```yml\nversion: \"3\"\n\nservices:\n  rutorrent:\n    image: linuxserver/rutorrent:latest\n    container_name: rutorrent\n    environment:\n      - PUID=1000\n      - PGID=1000\n    volumes:\n      - /path/to/rutorrent/config:/config\n      - /path/to/rutorrent/downloads:/downloads\n      - /run/php:/run/php\n    ports:\n      - 80:80\n      - 51413:51413\n      - 6881:6881/udp\n    restart: unless-stopped\n```\n\nRun linuxserver/rutorrent\n\n```sh\ndocker-compose up -d\n```\n\nCreate your rtorrent-cleaner script in `/usr/local/bin` folder\n\n```sh\n#!/usr/bin/env sh\n\ndocker run -it --rm \\\n  -e PHP_MEMORY_LIMIT=128M \\\n  -e PHP_TIMEZONE=Europe/Paris \\\n  -v /path/to/rutorrent/downloads:/downloads \\\n  -v /run/php:/run/php \\\n  magicalex/rtorrent-cleaner $*\n```\n\nAfter this step you can run rtorrent-cleaner\n\n```sh\nchmod +x /usr/local/bin/rtorrent-cleaner\nrtorrent-cleaner report /run/php/.rtorrent.sock\n```\n\n## Build docker image\n\n```sh\ndocker build -t magicalex/rtorrent-cleaner:latest https://github.com/Magicalex/rtorrent-cleaner.git\n```\n\n## Build Phar Archive (rtorrent-cleaner.phar)\n\nTo build the archive phar, php 7.2 and `php-phar` extension is required.\n\n```sh\ngit clone https://github.com/Magicalex/rtorrent-cleaner.git\ncd rtorrent-cleaner\ncomposer build\n```\n\n## License\n\nrtorrent-cleaner is released under the [MIT License](https://github.com/Magicalex/rtorrent-cleaner/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal3xLvs%2Frtorrent-cleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fal3xLvs%2Frtorrent-cleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal3xLvs%2Frtorrent-cleaner/lists"}