Bash Removing Torrents

General support for problems installing or using Deluge
New User
New User
Posts: 5
Joined: Sun Jun 23, 2019 11:40 pm

Bash Removing Torrents

Postby eld » Fri May 15, 2020 2:02 am

Personally I had found a lot of issues with the plugins for removing torrents and their data. Mostly because I do not seed, yes shame me. However just want to relay the script if anyone wants it / wants to adjust it to their needs. Quick run through, connecting to deluge with deluge-console grabbing "info" and parsing that information to just get the torrent ID. Then just removing all the torrents from "removetorrents.txt". Enjoy, let me know if you had a question.

Code: Select all


deluge-console "connect <username> <password> ; info" |grep "100%" | awk '{print $NF}' > /home/deluge/.config/deluge/removetorrents.txt

while read i
        deluge-console "connect <username> <password>; rm --remove_data -c '$i'"
 done < /home/deluge/.config/deluge/removetorrents.txt

EDIT: This is Ubuntu, should work with most linux distro. Also if you want to avoid just using plugins all together, you can just adjust the "grep" to be whatever you want. For example, grep -i <state of torrent>. Which just greps that entire line for say "seeding" or "complete".

Compulsive Poster
Compulsive Poster
Posts: 583
Joined: Sat Oct 08, 2016 9:28 am

Re: Bash Removing Torrents

Postby shamael » Mon May 18, 2020 9:38 am

thx for sharing it ;)

Return to “Support”

Who is online

Users browsing this forum: No registered users and 5 guests