not all torrents moved after completion

jith45

Member
May 25, 2018
960
0
16
Hi all,

I am a recent convert to rtorrent and rutorrent and am just in the process of setting up my rtorrent.rc. I already tried out the rutorrent interface as well, but first of all, I'd like to get rtorrent to behave as intended.

I do realise that in my rtorrent.rc I'll have to change the custom1 to a named variable if I use it with rutorrent, but just for the sake of testing this, I haven't changed that just yet.

my problem: not all torrents are moved to their respective 'completed' folder.
To me there doesn't seem to be a system behind this, as it seems to occur rather randomly. I read some people had trouble with torrents in directories or single file torrents, but it affects both kinds sometimes while it works sometimes as well.

I have different watch folders for different trackers and respective 'completed' folders as well:

Code:

scgi_port = 127.0.0.1:5555
encoding_list = UTF-8
system.file_allocate.set = yes
network.http.ssl_verify_peer.set=0
min_peers = 20
max_peers = 50
download_rate = 500
upload_rate = 75

directory = /mnt/Vault.1/bittorrent/downloading/
session = /mnt/Vault.1/bittorrent/.rtorrentsession/

schedule = filter_active,10,10,"view_filter = active,\"or={d.get_up_rate=,d.get_down_rate=}\""

schedule = watch_directory_1,10,10,"load=/mnt/Vault.1/bittorrent/torrentwatch/*.torrent,d.set_custom1=/mnt/Vault.1/bittorrent/completed/misc/"
schedule = watch_directory_2,10,10,"load=/mnt/Vault.1/bittorrent/torrentwatch/ebooks/*.torrent,d.set_custom1=/mnt/Vault.1/bittorrent/completed/ebooks/"
schedule = watch_directory_3,10,10,"load=/mnt/Vault.1/bittorrent/torrentwatch/alt/*.torrent,d.set_custom1=/mnt/Vault.1/bittorrent/completed/alt/"
schedule = watch_directory_4,10,10,"load_start=/mnt/Vault.1/bittorrent/torrentwatch/uploads/*.torrent,d.set_custom1=/mnt/Vault.1/bittorrent/uploads/"
schedule = watch_directory_5,10,10,"load=/mnt/Vault.1/bittorrent/torrentwatch/misc/*.torrent,d.set_custom1=/mnt/Vault.1/bittorrent/completed/misc/"

# check if torrent is in it's destination folder(false) or somewhere else(true)
system.method.insert=checkdirs1,simple,"not=\"$equal={d.get_custom1=,d.get_base_path=}\""

# check if torrent is 100% complete, the previous command returned true(not in destination folder) and if custom1 (destination folder) exists
system.method.insert=movecheck1,simple,"and={checkdirs1=,d.get_complete=,d.get_custom1=}"

# if the two previous lines gave incentive to move the files to the destination folder - this is done here. rtorrent knows the new folder and keeps seeding.
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="

#move when hash is completed - easier to add uploads
system.method.set_key=event.download.hash_done,move_hashed1,"branch={$movecheck1=,movedir1=}"

schedule = low_diskspace,5,60,close_low_diskspace=100M
port_range = 54005-54005
check_hash = yes
use_udp_trackers = yes
encryption = allow_incoming,try_outgoing,enable_retry,prefer_plaintext
dht = auto
dht_port = 54006
peer_exchange = yes

Most of the times it either works or simply doesn't and the torrent is seeded from the 'downloading' directory where all my current leeches are.
Rarely I get this error
Code:
Inactive: Download registered as completed, but hash check returned unfinished chunks.what happens here is that the torrent files are moved but the label isn't set correctly and it tries to find the torrent in the downloading directory.

Please, please, please help me smiley.gif
 

dsouvik215

Member
May 25, 2018
896
0
16
ruTorrent use custom1 for label storage. As result, you have two variants:
1) Remove all "schedule" and "system.method.insert" and use AutoTools plugin instead (AutoWatch feature). Or
2) Replace custom1 in rtorrent.rc to some named custom.
d.set_custom=custom_name,custom_value
d.get_custom=custom_value
etc.
 

jith45

Member
May 25, 2018
960
0
16
Thanks dsouvik215,

I was somewhat aware of changing the variable but the main issue is that the torrents are not moved correctly rather often.
Not sure if this would change with autotools, but before I resort to that solution, I'd prefer to have it working in rtorrent.

to clarify: the rtorrent.rc is used without rutorrent for now, so obviously the custom1 would have to be changed in the next step...
 

dsouvik215

Member
May 25, 2018
896
0
16
If without ruTorrent... hm... don't know really. Try to check this line -

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="

It is correct for rtorrent versions >= 0.8.9 (AFAIR). For previous you must *first* move files and only after that set directory.
Also, i think, you must do this on event.download.finished event instead event.download.hash_done (and without stop|start - otherwise you will have troubles with tracker's statistic).