LINUX.ORG.RU

rtorrent перемещение complete файлов

 


0

1
# min_peers_seed = 0
# max_peers_seed = 0
# max_uploads_div = 1
# max_downloads_div = 1

# download_rate = 200
# max_uploads = 0
# upload_rate = 10

# min_peers = 40
# max_peers = 52

min_peers = 1
max_peers = 10
min_peers_seed = 10
max_peers_seed = 52
max_uploads = 0
# download_rate = 150
download_rate = 0
upload_rate = 0


session = ~/torrents/session/

# port range
port_range = 1024-65535

# Start opening ports at a random position within the port range.
port_random = yes

check_hash = yes
session_save = yes
use_udp_trackers = yes

dht = auto
dht_port = 6881

encryption = allow_incoming,enable_retry,prefer_plaintext
encoding_list = UTF-8

# Enable peer exchange (for torrents not marked private)
peer_exchange = yes

# # load from ~/torrent/torrent_auto_load/ torrent files
# schedule = watch_directory,5,5,load_start=~/torrents/torrent_auto_load/*.torrent

# # stop if deleted
# # schedule = untied_directory,5,5,stop_untied=

# # Close torrents when diskspace is low.
# schedule = low_diskspace,5,60,close_low_diskspace=1024M

# # Periodically save session data
# schedule = session_save,240,300,session_save=

# # Move files to ~/torrents/complete when file is hashed
# # system.method.set_key = event.download.hash_done,move_hashed1,"execute=mv,-u,$d.get_base_path=,~/torrents/complete;d.set_directory=~/torrents/complete"

# # Move files to ~/torrents/complete when download completes
# system.method.set_key=event.download.finished,move_complete,"execute=mv,-u,$d.get_base_path=,~/torrents/complete;d.set_directory=~/torrents/complete"

# # This is to assure that if files "disappear" of the watch folders they will be loaded again if they manage to come back.
# # schedule=reload_torrent,0,60,"start_tied="

# # ^c d.multicall=,d.start=
# # ^x d.multicall=,d.stop=

# location where new torrent data is placed, and where you should place your
# 'complete' data before you place your *.torrent file into the watch folder
directory = /mnt/d/torrents/incomplete

# schedule a timer event named 'watch_directory_1':
# 1) triggers 10 seconds after rtorrent starts
# 2) triggers at 10 second intervals thereafter
# 3) Upon trigger, attempt to load (and start) new *.torrent files found in /home/user/torrents/watch/
# 4) set a variable named 'custom1' with the value "/home/user/torrents/complete"
# NOTE: if you do not want it to automatically start the torrent, change 'load_start' to 'load'
schedule = watch_directory_1,10,10,"load_start=/home/user/torrents/torrent_auto_load/*.torrent,d.set_custom1=/home/user/torrents/complete"

# insert a method with the alias 'checkdirs1'
# 1) returns true if the current path of the torrent data is not equal to the value of custom1
# 2) otherwise, returns false
system.method.insert=checkdirs1,simple,"not=\"$equal={d.get_custom1=,d.get_base_path=}\""

# insert a method with the alias 'movecheck1'
# 1) returns true if all 3 commands return true ('result of checkdirs1' && 'torrent is 100% done', 'custom1 variable is set')
# 2) otherwise, returns false
system.method.insert=movecheck1,simple,"and={checkdirs1=,d.get_complete=,d.get_custom1=}"

# insert a method with the alias 'movedir1'
# (a series of commands, separated by ';') 
# 1) "set path of torrent to equal the value of custom1";
# 2) "mv -u <current data path> <custom1 path>";
# 3) "clear custom1", "stop the torrent","resume the torrent"
# 4) stop the torrent
# 5) start the torrent (to get the torrent to update the 'base path')
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="

# set a key with the name 'move_hashed1' that is triggered by the hash_done event.
# 1) When hashing of a torrent completes, this custom key will be triggered.
# 2) when triggered, execute the 'movecheck1' method and check the return value.
# 3) if the 'movecheck' method returns 'true', execute the 'movedir1' method we inserted above.
# NOTE-0: *Only* data that has had their hash checked manually with ^R [^R = Control r].
# Or on a rtorrent restart[which initiates a hash check]. Will the data move; ~/torrents/incomplete => ~/torrents/complete for example.
# NOTE-1: 'branch' is an 'if' conditional statement: if(movecheck1){movedir1}
system.method.set_key=event.download.hash_done,move_hashed1,"branch={$movecheck1=,movedir1=}"

# display only active torrents
schedule = filter_active,30,30,"view_filter = active,\"or={d.get_up_rate=,d.get_down_rate=}\""

# vim:ft=sh

Но при завершении закачки не перемещает файлы в ~/torrents/complete

★★★★

Последнее исправление: bryak (всего исправлений: 1)

Ответ на: комментарий от windusjatnik

видимо мне хочется, чтобы незавершенные торренты были в /mnt/d/torrents/incomplete/

а завершенные в /home/user/torrents/complete/

bryak ★★★★
() автор топика
22 июля 2015 г.

Возможно я немного припоздал, но может кому и пригодится. У меня, почему-то, по окончании загрузки rtorrent не проверяет хэш, а проверяет только при старте rtorrent'а, в итоге перенос файлов начанается при запуске программы. Я настроил так:

system.method.insert=movecheck1,simple,"and={d.get_complete=,d.get_custom1=}"
system.method.insert=movedir1,simple,"d.set_directory=$d.get_custom1=;execute=mv,-u,$d.get_base_path=,$d.get_custom1=;d.stop=;d.start="
system.method.set_key = event.download.finished,move_complete,"branch={$movecheck1=,movedir1=}"
Я убрал одну лишнюю проверку checkdirs1, в методе movedir1 убрал d.set_custom1=; что бы не удалялись метки у завершенных закачек.
А срабатывает это по событию event.download.finished, т.е. когда закачка завершается. При этом никто не мешает вручную проверить хеш и если какая ошибка - докачать уже в конечной директории.
Автопроверку хеша на всякий случай выключил. check_hash = no

lucky_guy ★★★
()

Потом пораскинул немного и сделал так:

schedule = watch_directory_1,10,30,"load=/mnt/storage/torrents/films/*.torrent,d.set_custom1=films"
schedule = watch_directory_2,15,30,"load=/mnt/storage/torrents/serials/*.torrent,d.set_custom1=serials"
schedule = watch_directory_3,20,30,"load=/mnt/storage/torrents/porn/*.torrent,d.set_custom1=porn"
schedule = watch_directory_4,25,30,"load=/mnt/storage/torrents/games/*.torrent,d.set_custom1=games"
schedule = watch_directory_5,30,30,"load=/mnt/storage/torrents/books/*.torrent,d.set_custom1=books"
schedule = watch_directory_6,35,30,"load=/mnt/storage/torrents/other/*.torrent,d.set_custom1=other"

system.method.insert = check_for_readiness,simple,"and={d.get_complete=,d.get_custom1=}"
system.method.insert = set_final_dir,simple,"cat=/mnt/storage/media/,$d.get_custom1="
system.method.insert = move_torrent,simple,"d.set_directory=$set_final_dir=;execute=mv,-u,$d.get_base_path=,$set_final_dir=;d.stop=;d.start="
system.method.set_key = event.download.finished,move_complete,"branch={$check_for_readiness=,move_torrent=}"
При этом в вебморде появляется человеческая метка с пиктограммкой

lucky_guy ★★★
()
Ответ на: комментарий от bryak

мне ж не 10 лет) И даже для этой метки рарзрабы заботливо положили пиктограммку. Все они находятся сдесь

rutorrent/plugins/tracklabels/labels

можно менять пикчи для метки просто переименовав понравившееся изображение в имя своей метки.

А вообще этот способ я придумывал что бы избавиться от одной дикой фитчи: если в переменную custom1 сразу занести полный путь, то rtorrent сохраняет завершенную закачку как

%2Fmnt%2Fstorage%2Fmedia%2Fother%2F

хотя выставлен параметр encoding_list = UTF-8 и Windows 1251 в системе полностью отсутствует.

lucky_guy ★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.