All Projects → Magicalex → Rtorrent Cleaner

Magicalex / Rtorrent Cleaner

Licence: mit
🧹 rtorrent-cleaner is a tool to clean up unnecessary files in rtorrent

Projects that are alternatives of or similar to Rtorrent Cleaner

Composer Cleaner
Victor The Cleaner: removes unnecessary files from vendor directory
Stars: ✭ 114 (+216.67%)
Mutual labels:  cleaner, composer
comphar
Pack all composer dependencies into a single phar file.
Stars: ✭ 67 (+86.11%)
Mutual labels:  composer, phar
Cleaner 42
Only for 42Network schools, Cleaner_42 script is linked to cclean command/program, and it saves you some memory space.
Stars: ✭ 186 (+416.67%)
Mutual labels:  clean, cleaner
Mix Phar Skeleton
Phar command line program development skeleton
Stars: ✭ 81 (+125%)
Mutual labels:  console, phar
Tin Summer
Find build artifacts that are taking up disk space
Stars: ✭ 259 (+619.44%)
Mutual labels:  clean, cleaner
Laravel Zero
A PHP framework for console artisans
Stars: ✭ 2,821 (+7736.11%)
Mutual labels:  console, composer
seedbox-from-scratch
The Dockered Seedbox From Scratch Mod 2 Script
Stars: ✭ 14 (-61.11%)
Mutual labels:  rtorrent, rutorrent
Arch Rtorrentvpn
Docker build script for Arch Linux base with ruTorrent, rTorrent, autodl-irssi, Privoxy and OpenVPN
Stars: ✭ 185 (+413.89%)
Mutual labels:  rtorrent, rutorrent
conso
💢 PHP console applications for cool kids 💢
Stars: ✭ 40 (+11.11%)
Mutual labels:  console, composer
acquia cli
Provides a Robo console application to the Acquia CloudAPI for managing deployment tasks and environment configuration.
Stars: ✭ 30 (-16.67%)
Mutual labels:  console, phar
Pharbuilder
Create Phar of Composer based PHP application
Stars: ✭ 122 (+238.89%)
Mutual labels:  phar, composer
Modclean
Remove unwanted files and directories from your node_modules folder
Stars: ✭ 309 (+758.33%)
Mutual labels:  clean, cleaner
Tooly Composer Script
Simple composer script to manage phar files using project composer.json.
Stars: ✭ 87 (+141.67%)
Mutual labels:  phar, composer
Skrub
A package to remove junk from Composer installations and trim build sizes.
Stars: ✭ 91 (+152.78%)
Mutual labels:  cleaner, composer
Thoradia
Thoradia Add-ons Repository
Stars: ✭ 208 (+477.78%)
Mutual labels:  rtorrent, rutorrent
MySB
MySB (MySeedBox) is more than a simplified installation script of a multi-users Seedbox. There are many solutions to install a Seedbox, but we never talk about safety and regular operations. MySB could be renamed MySSB (MySecuredSeedBox).
Stars: ✭ 105 (+191.67%)
Mutual labels:  rtorrent, rutorrent
Pimp My Box
🌱 Automated seedbox install of rTorrent-PS and PyroScope CLI etc. via Ansible.
Stars: ✭ 127 (+252.78%)
Mutual labels:  rtorrent, rutorrent
Rutorrent Bonobox
Auto install script for rTorrent with ruTorrent
Stars: ✭ 161 (+347.22%)
Mutual labels:  rtorrent, rutorrent
cli
Aplus Framework CLI Library
Stars: ✭ 104 (+188.89%)
Mutual labels:  console, composer
Php Console
🖥 PHP CLI application library, provide console argument parse, console controller/command run, color style, user interactive, format information show and more. 功能全面的PHP命令行应用库。提供控制台参数解析, 命令运行,颜色风格输出, 用户信息交互, 特殊格式信息显示
Stars: ✭ 310 (+761.11%)
Mutual labels:  console, phar

rtorrent-cleaner

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

styleci stable GitHub All Releases

Requirements

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

Installation

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.

Install rtorrent-cleaner from composer

Install rtorrent-cleaner in global

composer global require magicalex/rtorrent-cleaner

Install rtorrent-cleaner from DockerHub

Requirements

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

See the details here

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

Environment variables

Variable Description Type Default value
PHP_MEMORY_LIMIT Memory limit directive of php optional 128M
PHP_TIMEZONE Timezone directive of php optional UTC

Info: change <container_name> by the name of your container of rtorrent
Info: change </home/user/downloads> by your downloads folder
Info: change </data/downloads> by directory.default of rtorrent. See your file rtorrent.rc

Command for displaying help: rtorrent-cleaner

docker run -it --rm \
  -v </home/user/downloads>:</data/downloads> \
  --link <container_name>:rtorrent \
  magicalex/rtorrent-cleaner

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

docker run -it --rm \
  -v </home/user/downloads>:</data/downloads> \
  --network <network_name> \
  --link <container_name>:rtorrent \
  magicalex/rtorrent-cleaner

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

docker run -it --rm \
  -v </home/user/downloads>:</data/downloads> \
  --network <network_name> \
  --link <container_name>: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 </home/user/downloads>:</data/downloads> \
  --network <network_name> \
  --link <container_name>: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 </home/user/downloads>:</data/downloads> \
  --network <network_name> \
  --link <container_name>:rtorrent \
  magicalex/rtorrent-cleaner

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

#!/usr/bin/env sh

docker run -it --rm \
  -v </home/user/downloads>:</data/downloads> \
  --network <network_name> \
  --link <container_name>: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 </home/user/downloads>:</data/downloads> \
  -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

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

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

Build Phar Archive (rtorrent-cleaner.phar)

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

rtorrent-cleaner is released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].