docker-rtorrent-rutorrent icon indicating copy to clipboard operation
docker-rtorrent-rutorrent copied to clipboard

Custom method.set_key = event.download.finished not running

Open natloh opened this issue 2 years ago • 9 comments

I am trying to run a script when torrents finish to tell sickchill that it's time to post process a download. I can't seem to edit the method.set_key = event.download.finished to trigger a custom script.

Is there any way to test this? I've been editing the .rtorrent.rc file and re-deploying the docker container with the new config but I am not seeing anything happen.

This is what is in my .rtorrent.rc

method.set_key = event.download.finished,TorrentToMedia,"execute=/usr/bin/python3,/data/rtorrent/scripts/nzbToMedia-master/TorrentToMedia.py,$d.base_path=,$d.name=,$d.custom1=,$d.hash="

natloh avatar Dec 12 '22 15:12 natloh

This is what is in my .rtorrent.rc

This is your full .rtorrent.rc file content?

Any logs?

crazy-max avatar Dec 30 '22 06:12 crazy-max

Hi

I’m having the same issue with both :latest and :edge

My .rtorrent.rc within the volume that resolves to /data/rtorrent/ is as follows, mostly the default until the last few lines and some bits disabled

throttle.min_peers.normal.set = 1
throttle.max_peers.normal.set = 100

# Same as above but for seeding completed torrents (-1 = same as downloading)
throttle.min_peers.seed.set = 1
throttle.max_peers.seed.set = 50

# Maximum number of simultanious uploads per torrent
throttle.max_uploads.set = 15

# Global upload and download rate in KiB. "0" for unlimited
throttle.global_down.max_rate.set_kb = 0
throttle.global_up.max_rate.set_kb = 0

# Enable DHT support for trackerless torrents or when all trackers are down
# May be set to "disable" (completely disable DHT), "off" (do not start DHT),
# "auto" (start and stop DHT as needed), or "on" (start DHT immediately)
#dht.mode.set = auto

# Enable peer exchange (for torrents not marked private)
protocol.pex.set = yes

# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported
pieces.hash.on_completion.set = yes

# Set whether the client should try to connect to UDP trackers
#trackers.use_udp.set = yes

# Set the max amount of memory address space used to mapping file chunks. This refers to memory mapping, not
# physical memory allocation. Default: 1GB (max_memory_usage)
# This may also be set using ulimit -m where 3/4 will be allocated to file chunks
#pieces.memory.max.set = 1GB

# Alternative calls to bind and ip that should handle dynamic ip's
#schedule2 = ip_tick,0,1800,ip=rakshasa
#schedule2 = bind_tick,0,1800,bind=rakshasa

# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
protocol.encryption.set = allow_incoming,try_outgoing,enable_retry

# Set the umask for this process, which is applied to all files created by the program
system.umask.set = 0022

# Add a preferred filename encoding to the list
encoding.add = UTF-8

# Watch a directory for new torrents, and stop those that have been deleted
#schedule2 = watch_directory, 1, 1, (cat,"load.start=",(cfg.watch),"*.torrent")
#schedule2 = untied_directory, 5, 5, (cat,"stop_untied=",(cfg.watch),"*.torrent")

# Close torrents when diskspace is low
schedule2 = monitor_diskspace, 15, 60, ((close_low_diskspace,1000M))

# Move finished (no need Autotools/Automove plugin on ruTorrent)
#method.insert = d.get_finished_dir, simple, "cat=$cfg.download_complete=,$d.custom1="
#method.insert = d.move_to_complete, simple, "d.directory.set=$argument.1=; execute=mkdir,-p,$argument.1=; execute=mv,-u,$argument.0=,$argument.1=; d.save_full_session="
#method.set_key = event.download.finished,move_complete,"d.move_to_complete=$d.data_path=,$d.get_finished_dir="
method.set_key = event.download.finished, "execute2={ls -Al /data/,>,/data/test.log}"

# Erase data when torrent deleted (no need erasedata plugin on ruTorrent)
method.set_key = event.download.erased,delete_erased,"execute=rm,-rf,--,$d.data_path="

dht.mode.set = on
trackers.use_udp.set = yes
ratio.enable=
ratio.min.set=200
ratio.max.set=500
ratio.upload.set=1024M
method.set = group.seeding.ratio.command, "d.close= ; execute2={sh,/data/.rtorrent.sh,$d.base_path=,$d.custom1=,$d.is_multi_file=} ; d.erase="

This works on a directly installed, non docker, rtorrent in this way, it needs the ratio parts for the script from what I can tell. If I connect into the docker container the file is definitely at that path and does run manually

All I get in rtorrent logs is this

1675288745 N rtorrent main: Starting thread.
1675408368 N rtorrent scgi: Shutting down thread.
1675408368 N rtorrent main: Shutting down thread.
1675408368 N rtorrent disk: Shutting down thread.

Do you need anything else?

Thanks

updated to correct multi line code block

HuwSy avatar Feb 12 '23 05:02 HuwSy

@HuwSy Multiline code must be between 3 backticks ``` Select all lines, then click Add code button.

simonc56 avatar Feb 12 '23 11:02 simonc56

@HuwSy Multiline code must be between 3 backticks ``` Select all lines, then click Add code button.

Thanks. Fixed that now and learnt something new :)

HuwSy avatar Feb 12 '23 21:02 HuwSy

I've been editing the .rtorrent.rc file and re-deploying the docker container with the new config but I am not seeing anything happen.

This is what is in my .rtorrent.rc

method.set_key = event.download.finished,TorrentToMedia,"execute=/usr/bin/python3,/data/rtorrent/scripts/nzbToMedia-master/TorrentToMedia.py,$d.base_path=,$d.name=,$d.custom1=,$d.hash="

Change execute to execute2 as said here : https://github.com/rakshasa/rtorrent/issues/242

simonc56 avatar Feb 13 '23 14:02 simonc56

@HuwSy

method.set_key = event.download.finished, "execute2={ls -Al /data/,>,/data/test.log}"

You didn't write the key. See your previous line has a key named move_complete

rtorrent doc states : method.set_key = ‹name›, ‹key›[, ‹definition›] 0

simonc56 avatar Feb 13 '23 14:02 simonc56

@HuwSy

method.set_key = event.download.finished, "execute2={ls -Al /data/,>,/data/test.log}"

You didn't write the key. See your previous line has a key named move_complete

rtorrent doc states : method.set_key = ‹name›, ‹key›[, ‹definition›] 0

Mine turns out to be my own fault. I had been locking down permissions and impacted my config directory. The give away should have been my logs never changing but I didn’t even notice they were stuck until I looked at the dates.

Oddly method.set = , for the option I have here works. No idea why or even where I copied this approach from but that’s not for here.

HuwSy avatar Feb 13 '23 18:02 HuwSy

Hi, also have this issue. method.set_key = event.download.paused, test, "execute={echo $d.name= > /data/log.txt}"

 echo $d.name= > /data/log.txt
---
 
--- Error ---

rachffus avatar Apr 04 '24 19:04 rachffus

Have you read the thread ? Hint : https://github.com/crazy-max/docker-rtorrent-rutorrent/issues/191#issuecomment-1428055924

simonc56 avatar Apr 10 '24 20:04 simonc56