rTorrent下载完种子自动上传Google Drive

255次阅读

共计 725 个字符,预计需要花费 2 分钟才能阅读完成。

Rate this post

每次都要 ruTorrent + rTorrent 下载种子,再连 ssh 用 rclone copy 资源到 Google Drive。搜了下,发现 rTorrent 的配置里面可以做到完 成种子后自动发 Email,遂修改成了下载完自动上传 Google Drive。

将步骤简记如下(已安装 rTorrent 和 rclone 的直接忽略 1、2 步):
1. 用 https://github.com/arakasi72/rtinst 安装 rTorrent

2. 安装并配置 rclone

3. 新建上传脚本并赋予可执行权限 touch rtup.sh && chmod +x rtup.sh && vim rtup.sh

#!/bin/sh  src="/home/cody/rtorrent/download/"$1  dst="cody_gtl:@gdurl/"$1  rclone copy --ignore-existing "$src" "$dst"

4. 编辑 rTorrent 的配置文件 vim ~/.rtorrent.rc
增加一行配置

method.set_key = event.download.finished,notify_me,"execute=~/rtup.sh,$d.name="

当下载完成时,自动执行第 3 步新建的上传脚本,将文件(夹)copy 到 Google Drive。为方便操作,改成一行命令

sudo sed -i '$i method.set_key = event.download.finished,notify_me,"execute=~/rtup.sh,$d.name="' ~/.rtorrent.rc

5. 重启服务器 rt restart
这样 ruTorrent 中的任务,完成之后自动上传到 Google Drive。

正文完