rTorrent中schedule设置技巧

rTorrent中可以配置schedule让其监控某个指定目录,发现.torrent文件后自动下载。搭配事件控制可以达到讲下载好的文件自动移动到另一个目录并且继续做种的效果。

某些情况下我们希望监控多个目录,并且将下载完毕的文件根据种子源目录的不同移动到不同的目录,这时候就要用到下面的配置。

[code]
schedule = watch_directory_1,10,10,”load_start=~/Download/watch_stuff1/*.torrent,d.set_custom1=~/Download/stuff1/”
schedule = watch_directory_2,10,10,”load_start=~/Download/watch_stuff2/*.torrent,d.set_custom1=~/Download/stuff2/”

# 下载完成后将文件移动到变量custom1指定的目录
system.method.set_key =event.download.finished,move_complete,”d.set_directory=$d.get_custom1= ;execute=mv,-u,$d.get_base_path=,$d.get_custom1=”
[/code]

上面的mv就是指系统自带的命令。同理我们可以让rTorrent在下载完毕后执行指定的命令,比如发送一封email到指定信箱提醒。
[code]
# First and only argument to rtorrent_mail.sh is completed file’s name (d.get_name)
system.method.set_key = event.download.finished,notify_me,”execute=~/rtorrent_mail.sh,$d.get_name=”
[/code]
rtorrent_mail.sh如下
[code]
#!/bin/sh
echo “$(date) : $1 – Download completed.” | mail -s “[rtorrent] – Download completed : $1” alerts@example.com
[/code]

Leave a Reply

Your email address will not be published. Required fields are marked *