transmission-remote script not removing torrent

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
brisdude
Posts: 5
Joined: Wed May 23, 2018 10:36 am

transmission-remote script not removing torrent

Post by brisdude » Mon Mar 09, 2020 4:28 pm

I have a (bash) script that periodically looks for completed torrents that are above a certain ratio. When it finds a match, the script deletes the torrent.

The line is:

Code: Select all

transmission-remote -n <username>:<password> -t <torrentid> --remove
(I have also tried -r in place of --remove.)

Whatever I use, I am getting what I would expect back:

Code: Select all

localhost:9091/transmission/rpc/ responded: "success"
BUT the torrent is NOT being removed.

Any ideas how I can get this working please?

mike.dld
Transmission Developer
Posts: 283
Joined: Wed Dec 25, 2013 10:56 pm

Re: transmission-remote script not removing torrent

Post by mike.dld » Mon Mar 09, 2020 7:20 pm

It may depend on what you're using as `<torrentid>` there. When you're using something that's not "all", "active", real ID (like the one from the first column of `transmission-remote -l` output) or a range of IDs, or real hash, Transmission doesn't treat this as an error if it can't find the torrent(s) you want it to remove, i.e. -t is a filter that could match 0 torrents and that would be okay.

Another issue that could be there is the lack of proper quoting... Or maybe something else... It's quite hard to guess unless you attach the complete script instead of making us put bits and pieces together.

I'd suggest tracing the script, e.g. by running it manually with -x passed to the interpreter (or adding `set -x` at the beginning of the script), then confirming that what you're passing to transmission-remote is indeed valid.

brisdude
Posts: 5
Joined: Wed May 23, 2018 10:36 am

Re: transmission-remote script not removing torrent

Post by brisdude » Mon Mar 09, 2020 7:21 pm

[My post crossed with yours, so thanks for the reply.]

<torrentid> is an integer (a real ID) referring to the torrent I want to remove.

I have no idea why this fixed the problem, but it did:

Code: Select all

sh -c "transmission-remote -n <username>:<password> -t <torrentid> --remove"

Post Reply