Move erased torrents

randac56

Member
May 25, 2018
915
0
16
Hello,

This is not a Rutorrent problem, only a rtorrent problem, but I guess you can help me

I have a small problem with my rtorrent configuration, I based my config from https://wiki.archlinux.org/index.php/RTorrent.
My goal is to move the file at the end of the download (when hash here), then move it somewhere else when I remove the torrent file.
The first part is working nicely, the second one doesn't. I got the error : "Event 'event.download.erased' failed: Bad return code."

Can't understand why, could someone help me?
Thanks in advance


P.S.: rtorrent version 0.9.2-1


config (comments stripped):
Code: [Select]
download_rate = 1000
upload_rate = 80
directory = /home/raghnarok/torrent/data
session = /home/raghnarok/torrent/session
port_range = 6881-6999
port_random = no
check_hash = yes
schedule = watch_directory,10,10,"load_start=/home/raghnarok/torrent/torrent_active/watch/*.torrent,d.set_custom1=/home/raghnarok/torrent/completed,d.set_custom2=/home/raghnarok/torrent/finished"
schedule = watch_directory,10,10,"load_start=/home/raghnarok/torrent/torrent_active/watch/music/*.torrent,d.set_custom1=/home/raghnarok/torrent/completed/music,d.set_custom2=/home/raghnarok/torrent/finished/music"
system.method.insert=checkdirs1,simple,"not=\"$equal={d.get_custom1=,d.get_base_path=}\""
system.method.insert=checkdirs2,simple,"not=\"$equal={d.get_custom2=,d.get_base_path=}\""
system.method.insert=movecheck1,simple,"and={checkdirs1=,d.get_complete=,d.get_custom1=}"
system.method.insert=movecheck2,simple,"and={checkdirs2=,d.get_complete=,d.get_custom2=}"
system.method.insert=movedir1,simple,"d.set_directory=$d.get_custom1=;execute=mv,-u,$d.get_base_path=,$d.get_custom1=;d.set_custom1=;d.stop=;d.start="
system.method.insert=movedir2,simple,"d.set_directory=$d.get_custom2=;execute=mv,-u,$d.base_path=,$d.get_custom2=;d.set_custom2=;d.stop=;d.start="
system.method.set_key=event.download.hash_done,move_hashed1,"branch={$movecheck1=,movedir1=}"
system.method.set_key=event.download.erased,move_erased1,"branch={$movecheck2=,movedir2=}"
dht = auto
dht_port = 6880
encryption = allow_incoming,require,require_rc4
keys.layout.set = qwertz
 

saroos1

Member
May 25, 2018
718
0
16
Yeah, already tried this, I think i should keep get_base_path, but I didn't change it back.

Thanks for the reply anyways
 

peshua19

Member
May 25, 2018
897
0
16
1) try to use brackets.
system.method.insert=movedir2,simple,"d.set_directory=$d.get_custom2=;execute={mv,-u,$d.base_path=,$d.get_custom2=};d.set_custom2=;d.stop=;d.start="
2) try to add spaces after semicolons.
3) try to use your own script instead 'mv' and check inside - is it called, what about parameters etc.
 

saroos1

Member
May 25, 2018
718
0
16
Nice!!!

It's working with brackets!
Thanks bro <3

So if someone want it, this rtorrent.rc is working.
It's watching 'torrent_active' directory for new torrents, and 'torrent_active/music' too (I'll add some others later).
Downloading every torrent in 'data' directory.
Moving them to 'completed' and 'completed/music' when hash is checked.
Moving them to 'finished' and 'finished/music' when the torrent is deleted.

Thanks a lot