Rtorrent Cleaner script in php for remove unnecessary file in rtorrent
Switch branches/tags
Nothing to show
Clone or download
Latest commit 80a100d Dec 14, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin feat(): version 0.2.3 Dec 14, 2018
src fix(): rename movecommand Dec 14, 2018
.editorconfig first commit Nov 22, 2018
.gitignore feat(): add support of php5 phar archive Dec 14, 2018
.styleci.yml first commit Nov 22, 2018
LICENSE first commit Nov 22, 2018
README.md feat(): add support of php5 phar archive Dec 14, 2018
box.json feat(): add phar file Dec 11, 2018
composer.json fix(): composer.json Dec 14, 2018
nginx.conf feat(): add phar file Dec 11, 2018

README.md

rtorrent-cleaner

Script in php for remove unnecessary file in rtorrent.
Docker image: docker-rtorrent-cleaner

StyleCI Latest Stable Version Total Downloads License

Requirements

  • php 5.6 and above with extension php-bcmath and php-dom

Installation

Installation via phar file (recommended)

wget https://github.com/Magicalex/rtorrent-cleaner/releases/download/v0.2.2/rtorrent-cleaner.phar
mv rtorrent-cleaner.phar /usr/local/bin/rtorrent-cleaner
chmod +x /usr/local/bin/rtorrent-cleaner

Installation via composer

Install the dependencies for debian 9

apt-get install php php-bcmath php-dom

Install composer for root user

curl -s https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
chmod +x /usr/local/bin/composer
mkdir /root/.composer && composer install -d /root/.composer
echo 'export PATH="$PATH:/root/.composer/vendor/bin"' >> /root/.bashrc
source /root/.bashrc

Install rtorrent-cleaner in global

composer global require magicalex/rtorrent-cleaner

Usage

Command for displaying help:

rtorrent-cleaner

Command for making a report:

rtorrent-cleaner report --url-xmlrpc=http://localhost/RPC --home=/home/user/torrents

Command for remove unnecessary files:

rtorrent-cleaner rm --url-xmlrpc=http://localhost/RPC --home=/home/user/torrents

Command for remove unnecessary files without confirmation (--assume-yes):

rtorrent-cleaner rm --url-xmlrpc=http://localhost/RPC --home=/home/user/torrents --assume-yes

Command for move unnecessary files in a folder (here: /home/user/old) :

rtorrent-cleaner mv /home/user/old/ --url-xmlrpc=http://localhost/RPC --home=/home/user/torrents

Command for move unnecessary files in a folder (here: /home/user/old) without confirmation (--assume-yes):

rtorrent-cleaner mv /home/user/old/ --url-xmlrpc=http://localhost/RPC --home=/home/user/torrents --assume-yes

Option for ignore files (option --exclude=) :

rtorrent-cleaner report --exclude=*.sub,*.srt --url-xmlrpc=http://localhost/RPC --home=/home/user/torrents

This example exclude all files .sub and .srt in the output

Improve performance

Add this nginx.conf in your nginx configuration. Adapt your scgi address scgi_pass 127.0.0.1:5000; Check your nginx configuration and restart nginx.

Now, you can use --url-xmlrpc=http://127.0.0.1:8888 scgi mount point.

Build Phar rtorrent-cleaner.phar

composer global require humbug/box
git clone https://github.com/Magicalex/rtorrent-cleaner.git
cd rtorrent-cleaner
composer run-script build-phar-php5
composer run-script build-phar-php7

License

rtorrent-cleaner is released under the MIT License.

TODO

  • remove torrent without file ? (maybe stop torrent d.stop or d.erase)
  • add log file support