document.writeln('');
Aria2 完美配置是一套 Aria2 配置方案,包含了配置文件、附加功能脚本等文件,用于实现 Aria2 功能的增强和扩展,提升 Aria2 的下载速度与使用体验,解决 Aria2 在使用中遇到的 BT 下载无速度、文件残留占用磁盘空间、任务丢失、重复下载等问题。
为了确保能正常使用,请先安装基础组件wget、curl、ca-certificates,以 Debian/centos为例子:
<span class="hljs-attribute">apt</span> install wget curl ca-certificates <span class="hljs-comment">#debian</span>yum install wget curl ca-certificates <span class="hljs-comment">#centos</span><span class="hljs-attribute">apt</span> install wget curl ca-certificates <span class="hljs-comment">#debian</span> yum install wget curl ca-certificates <span class="hljs-comment">#centos</span>apt install wget curl ca-certificates #debian yum install wget curl ca-certificates #centos
<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.shwget -N git.io/aria2.sh && chmod +x aria2.sh
Aria2项目GITHUB:
./aria2.sh./aria2.sh./aria2.sh
Aria2 一键安装管理脚本 增强版 [v2<span class="hljs-number">.7</span><span class="hljs-number">.4</span>] <span class="hljs-keyword">by</span> P3TERX.COM<span class="hljs-number">0.</span> 升级脚本———————————————————————<span class="hljs-number">1.</span> 安装 Aria2<span class="hljs-number">2.</span> 更新 Aria2<span class="hljs-number">3.</span> 卸载 Aria2———————————————————————<span class="hljs-number">4.</span> 启动 Aria2<span class="hljs-number">5.</span> 停止 Aria2<span class="hljs-number">6.</span> 重启 Aria2———————————————————————<span class="hljs-number">7.</span> 修改 配置<span class="hljs-number">8.</span> 查看 配置<span class="hljs-number">9.</span> 查看 日志<span class="hljs-number">10.</span> 清空 日志———————————————————————<span class="hljs-number">11.</span> 手动更新 BT-Tracker<span class="hljs-number">12.</span> 自动更新 BT-Tracker———————————————————————Aria2 状态: 已安装 | 已启动自动更新 BT-Tracker: 已开启请输入数字 [<span class="hljs-number">0</span><span class="hljs-number">-12</span>]:Aria2 一键安装管理脚本 增强版 [v2<span class="hljs-number">.7</span><span class="hljs-number">.4</span>] <span class="hljs-keyword">by</span> P3TERX.COM <span class="hljs-number">0.</span> 升级脚本 ——————————————————————— <span class="hljs-number">1.</span> 安装 Aria2 <span class="hljs-number">2.</span> 更新 Aria2 <span class="hljs-number">3.</span> 卸载 Aria2 ——————————————————————— <span class="hljs-number">4.</span> 启动 Aria2 <span class="hljs-number">5.</span> 停止 Aria2 <span class="hljs-number">6.</span> 重启 Aria2 ——————————————————————— <span class="hljs-number">7.</span> 修改 配置 <span class="hljs-number">8.</span> 查看 配置 <span class="hljs-number">9.</span> 查看 日志 <span class="hljs-number">10.</span> 清空 日志 ——————————————————————— <span class="hljs-number">11.</span> 手动更新 BT-Tracker <span class="hljs-number">12.</span> 自动更新 BT-Tracker ——————————————————————— Aria2 状态: 已安装 | 已启动 自动更新 BT-Tracker: 已开启 请输入数字 [<span class="hljs-number">0</span><span class="hljs-number">-12</span>]:Aria2 一键安装管理脚本 增强版 [v2.7.4] by P3TERX.COM 0. 升级脚本 ——————————————————————— 1. 安装 Aria2 2. 更新 Aria2 3. 卸载 Aria2 ——————————————————————— 4. 启动 Aria2 5. 停止 Aria2 6. 重启 Aria2 ——————————————————————— 7. 修改 配置 8. 查看 配置 9. 查看 日志 10. 清空 日志 ——————————————————————— 11. 手动更新 BT-Tracker 12. 自动更新 BT-Tracker ——————————————————————— Aria2 状态: 已安装 | 已启动 自动更新 BT-Tracker: 已开启 请输入数字 [0-12]:
Aria2 简单配置信息:IPv4 地址 : <span class="hljs-emphasis">*.*</span>.<span class="hljs-emphasis">*.*</span>IPv6 地址 : IPv6 地址检测失败RPC 端口 : 6800RPC 密钥 : 122sd1111123456df42下载目录 : /root/downloadsAriaNg 链接 : http://ariang.js.org/#!/settings/rpc/set/ws/<span class="hljs-emphasis">*.*</span>.<span class="hljs-emphasis">*.*</span>/6800/jsonrpc/ZjFdfkdikDAmNDI=Aria2 简单配置信息: IPv4 地址 : <span class="hljs-emphasis">*.*</span>.<span class="hljs-emphasis">*.*</span> IPv6 地址 : IPv6 地址检测失败 RPC 端口 : 6800 RPC 密钥 : 122sd1111123456df42 下载目录 : /root/downloads AriaNg 链接 : http://ariang.js.org/#!/settings/rpc/set/ws/<span class="hljs-emphasis">*.*</span>.<span class="hljs-emphasis">*.*</span>/6800/jsonrpc/ZjFdfkdikDAmNDI=Aria2 简单配置信息: IPv4 地址 : *.*.*.* IPv6 地址 : IPv6 地址检测失败 RPC 端口 : 6800 RPC 密钥 : 122sd1111123456df42 下载目录 : /root/downloads AriaNg 链接 : http://ariang.js.org/#!/settings/rpc/set/ws/*.*.*.*/6800/jsonrpc/ZjFdfkdikDAmNDI=
Aria2 默认已经自带了Aria2NG了,打开:http://ariang.js.org/#xxxx那一串地址,就可以进入Aria2 离线下载界面了。
| 文件 | 说明 |
| aria2.conf | Aria2 配置文件。仅适用于 Aria2 1.35.0 及以上版本,在不了解的情况下修改可能导致本方案的特性失效。 |
| delete.sh | 文件删除脚本。在下载停止后执行(on-download-stop),自动删除文件及 .aria2 后缀名文件,防止不必要的磁盘空间占用。(默认启用) |
| clean.sh | 清理脚本。在下载完成后执行(on-download-complete),自动清除 .aria2 后缀名文件。(默认启用) |
| upload.sh | 上传脚本。在下载完成后执行(on-download-complete),自动调用 RCLONE 上传(move)下载的文件到网盘,并自动清除 .aria2 后缀名文件与空目录。(默认不启用) |
| move.sh | 文件移动脚本。在下载完成后执行(on-download-complete),自动将下载完成的文件移动到指定目录,并自动清除 .aria2 后缀名文件与空目录。(默认不启用) |
| tracker.sh | BT tracker 列表更新脚本。在 Aria2 配置文件(aria2.conf)所在目录执行即可获取最新 tracker 列表并添加到配置文件中。此脚本还有更强大的功能,具体使用方法详见 tracker.md |
| dht.dat dht6.dat |
DHT 文件。提升 BT 下载率和下载速度的关键之一。相关科普:《解决 Aria2 无法下载磁力链接、BT种子和速度慢的问题》 |
Aria2 一键安装管理脚本 增强版 整合了 Aria2 完美配置 ,安装后会附带一些附加功能脚本功能脚本,RCLONE 自动上传脚本就是其中之一。由于默认不启用,所以需要手动启用。
TIPS: 本项目的上传脚本使用更稳定快速的原生命令上传方式,而非处在测试阶段的挂载方式,这点和一般的脚本不同。
输入以下命令打开 Aria2 配置文件进行修改
nano <span class="hljs-regexp">/root/</span>.aria2c/aria2.confnano <span class="hljs-regexp">/root/</span>.aria2c/aria2.confnano /root/.aria2c/aria2.conf
或使用Aria2 一键安装管理脚本 增强版中的手动修改选项打开配置文件进行修改。找到“下载完成后执行的命令”,把clean.sh替换为upload.sh。
<span class="hljs-literal">on</span>-download-complete=<span class="hljs-regexp">/root/</span>.aria2c/upload.sh<span class="hljs-literal">on</span>-download-complete=<span class="hljs-regexp">/root/</span>.aria2c/upload.shon-download-complete=/root/.aria2c/upload.sh
nano 编辑器的操作方法参见《Linux 下适合新手的文本编辑器 nano 使用教程》
输入以下命令打开附加功能脚本配置文件进行修改
nano <span class="hljs-regexp">/root/</span>.aria2c/script.confnano <span class="hljs-regexp">/root/</span>.aria2c/script.confnano /root/.aria2c/script.conf
有中文注释,按照自己的实际情况进行修改,第一次使用只建议修改网盘名称。
<span class="hljs-attr">drive-name</span>=remote<span class="hljs-attr">drive-name</span>=remotedrive-name=remote
重启 Aria2 。脚本选项重启或者执行以下命令:
<span class="hljs-attribute">service</span> aria2 restart<span class="hljs-attribute">service</span> aria2 restartservice aria2 restart
执行upload.sh脚本,提示success即代上传脚本能正常被调用,否则请检查与 RCLONE 有关的配置。
<span class="hljs-regexp">/root/</span>.aria2c/upload.sh<span class="hljs-regexp">/root/</span>.aria2c/upload.sh/root/.aria2c/upload.sh
打开实时日志并下载任意文件,出现上传成功信息即代表配置成功,否则请认真阅读教程并重新开始。
检查网盘是否存在相关文件,若不存在说明你搞错网盘了。
Rclone是一个的命令行工具,支持在不同对象存储、网盘间同步、上传、下载数据。并且通过一些设置可以实现离线下载、服务器备份等非常实用的功能。这里以 OneDrive 和 Google Drive 为例子,进行连接配置,其它网盘的操作类似。由于是交互式配置选项,只要能看懂基本没有任何难度。
RCLONE 官方提供了一键安装脚本:
<span class="hljs-attribute">curl</span> https://rclone.org/install.sh | sudo bash<span class="hljs-attribute">curl</span> https://rclone.org/install.sh | sudo bashcurl https://rclone.org/install.sh | sudo bash
在本地Windows电脑上下载rclone win版,然后解压出来,解压后进入文件夹,在资源管理器地址栏输入cmd,回车就会在当前路径打开命令提示符。输入以下命令:
<span class="hljs-attribute">rclone</span> authorize <span class="hljs-string">"onedrive"</span><span class="hljs-attribute">rclone</span> authorize <span class="hljs-string">"onedrive"</span>rclone authorize "onedrive"
接下来会弹出浏览器,要求你登录账号进行授权。授权完后命令提示符窗口会出现以下信息:
If your browser doesnt open automatically go to the following link: http:<span class="hljs-comment">//127.0.0.1:53682/auth</span>Log in <span class="hljs-keyword">and</span> authorize rclone <span class="hljs-keyword">for</span> accessWaiting <span class="hljs-keyword">for</span> code...Got codePaste the following into your remote machine --->{<span class="hljs-string">"access_token"</span>:<span class="hljs-string">"xxxxxxxx"</span>} # 注意!复制{xxxxxxxx}整个内容,并保存好,后面需要用到<---End pasteIf your browser doesnt open automatically go to the following link: http:<span class="hljs-comment">//127.0.0.1:53682/auth</span> Log in <span class="hljs-keyword">and</span> authorize rclone <span class="hljs-keyword">for</span> access Waiting <span class="hljs-keyword">for</span> code... Got code Paste the following into your remote machine ---> {<span class="hljs-string">"access_token"</span>:<span class="hljs-string">"xxxxxxxx"</span>} # 注意!复制{xxxxxxxx}整个内容,并保存好,后面需要用到 <---End pasteIf your browser doesnt open automatically go to the following link: http://127.0.0.1:53682/auth Log in and authorize rclone for access Waiting for code... Got code Paste the following into your remote machine ---> {"access_token":"xxxxxxxx"} # 注意!复制{xxxxxxxx}整个内容,并保存好,后面需要用到 <---End paste
输入以下命令
<span class="hljs-attribute">rclone</span> config<span class="hljs-attribute">rclone</span> configrclone config
会出现以下信息,参照下面的注释进行操作。
TIPS: 因为 RCLONE 会时不时进行更新,当你看到这篇教程时菜单选项可能已经发生了略微的改动,但大致思路不会变,不要无脑照搬操作。
e) Edit existing remoten) New remoted) <span class="hljs-keyword">Delete</span> remoter) <span class="hljs-keyword">Rename</span> remotec) Copy remotes) <span class="hljs-keyword">Set</span> configuration <span class="hljs-keyword">password</span>q) Quit confige/n/d/r/c/s/q> n # 选择n,新建<span class="hljs-keyword">name</span>> remote # 输入名称,类似于标签,用于区分不同的网盘。<span class="hljs-keyword">Type</span> <span class="hljs-keyword">of</span> <span class="hljs-keyword">storage</span> <span class="hljs-keyword">to</span> configure.Enter a <span class="hljs-keyword">string</span> value. Press Enter <span class="hljs-keyword">for</span> the <span class="hljs-keyword">default</span> (<span class="hljs-string">""</span>).<span class="hljs-keyword">Choose</span> a <span class="hljs-built_in">number</span> <span class="hljs-keyword">from</span> below, <span class="hljs-keyword">or</span> <span class="hljs-keyword">type</span> <span class="hljs-keyword">in</span> your own <span class="hljs-keyword">value</span>[snip]XX / Microsoft OneDrive<span class="hljs-string">"onedrive"</span>[snip]<span class="hljs-keyword">Storage</span>>XX # 选择Microsoft OneDrive对应的数字Microsoft App <span class="hljs-keyword">Client</span> <span class="hljs-keyword">Id</span>Leave blank normally.Enter a <span class="hljs-keyword">string</span> value. Press Enter <span class="hljs-keyword">for</span> the <span class="hljs-keyword">default</span> (<span class="hljs-string">""</span>).client_id> # 留空,回车Microsoft App <span class="hljs-keyword">Client</span> SecretLeave blank normally.Enter a <span class="hljs-keyword">string</span> value. Press Enter <span class="hljs-keyword">for</span> the <span class="hljs-keyword">default</span> (<span class="hljs-string">""</span>).client_secret> # 留空,回车Edit <span class="hljs-keyword">advanced</span> config? (y/n)y) Yesn) <span class="hljs-keyword">No</span>y/n> n # 选nRemote config<span class="hljs-keyword">Use</span> <span class="hljs-keyword">auto</span> config?* Say Y <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> sure* Say N <span class="hljs-keyword">if</span> you <span class="hljs-keyword">are</span> working <span class="hljs-keyword">on</span> a remote <span class="hljs-keyword">or</span> headless machiney) Yesn) <span class="hljs-keyword">No</span>y/n> n # 选n<span class="hljs-keyword">For</span> this <span class="hljs-keyword">to</span> <span class="hljs-keyword">work</span>, you will need rclone available <span class="hljs-keyword">on</span> a machine that has a web browser available.<span class="hljs-keyword">Execute</span> the <span class="hljs-keyword">following</span> <span class="hljs-keyword">on</span> your machine:rclone authorize <span class="hljs-string">"onedrive"</span><span class="hljs-keyword">Then</span> paste the <span class="hljs-keyword">result</span> below:<span class="hljs-keyword">result</span>> {<span class="hljs-string">"XXXXXXXX"</span>} # 复制上面Win下获取的token值到这里<span class="hljs-keyword">Choose</span> a <span class="hljs-built_in">number</span> <span class="hljs-keyword">from</span> below, <span class="hljs-keyword">or</span> <span class="hljs-keyword">type</span> <span class="hljs-keyword">in</span> an existing <span class="hljs-keyword">value</span><span class="hljs-number">1</span> / OneDrive Personal <span class="hljs-keyword">or</span> Business<span class="hljs-string">"onedrive"</span><span class="hljs-number">2</span> / Sharepoint site<span class="hljs-string">"sharepoint"</span><span class="hljs-number">3</span> / <span class="hljs-keyword">Type</span> <span class="hljs-keyword">in</span> driveID<span class="hljs-string">"driveid"</span><span class="hljs-number">4</span> / <span class="hljs-keyword">Type</span> <span class="hljs-keyword">in</span> SiteID<span class="hljs-string">"siteid"</span><span class="hljs-number">5</span> / <span class="hljs-keyword">Search</span> a Sharepoint site<span class="hljs-string">"search"</span>Your choice> <span class="hljs-number">1</span> # 这里问你要选择的类型,选<span class="hljs-number">1</span><span class="hljs-keyword">Found</span> <span class="hljs-number">1</span> drives, please <span class="hljs-keyword">select</span> the one you want <span class="hljs-keyword">to</span> <span class="hljs-keyword">use</span>:<span class="hljs-number">0</span>: OneDrive (business) <span class="hljs-keyword">id</span>=b!Eqwertyuiopasdfghjklzxcvbnm<span class="hljs-number">-7</span>mnbvcxzlkjhgfdsapoiuytrewqkChose drive <span class="hljs-keyword">to</span> <span class="hljs-keyword">use</span>:> <span class="hljs-number">0</span> # 程序找到网盘,编号是什么数字就填什么数字,一般是<span class="hljs-number">0</span><span class="hljs-keyword">Found</span> drive <span class="hljs-string">root</span> <span class="hljs-keyword">of</span> <span class="hljs-keyword">type</span> <span class="hljs-string">business</span>, <span class="hljs-keyword">URL</span>: https://org-my.sharepoint.com/personal/you/Documents<span class="hljs-keyword">Is</span> that okay?y) Yesn) <span class="hljs-keyword">No</span>y/n> y<span class="hljs-comment">--------------------</span>[remote]<span class="hljs-keyword">type</span> = onedrivetoken = {<span class="hljs-string">"access_token"</span>:<span class="hljs-string">"youraccesstoken"</span>,<span class="hljs-string">"token_type"</span>:<span class="hljs-string">"Bearer"</span>,<span class="hljs-string">"refresh_token"</span>:<span class="hljs-string">"yourrefreshtoken"</span>,<span class="hljs-string">"expiry"</span>:<span class="hljs-string">"2021-12-07T09:39:52.486512262+08:00"</span>}drive_id = b!Eqwertyuiopasdfghjklzxcvbnm<span class="hljs-number">-7</span>mnbvcxzlkjhgfdsapoiuytrewqkdrive_type = business<span class="hljs-comment">--------------------</span>y) Yes this <span class="hljs-keyword">is</span> OKe) Edit this remoted) <span class="hljs-keyword">Delete</span> this remotey/e/d> y # 选y<span class="hljs-keyword">Current</span> remotes:<span class="hljs-keyword">Name</span> <span class="hljs-keyword">Type</span>==== ====remote onedrivee) Edit existing remoten) <span class="hljs-keyword">New</span> remoted) <span class="hljs-keyword">Delete</span> remoter) <span class="hljs-keyword">Rename</span> remotec) Copy remotes) <span class="hljs-keyword">Set</span> configuration <span class="hljs-keyword">password</span>q) Quit confige/n/d/r/c/s/q> q # 选q,退出e) Edit existing remote n) New remote d) <span class="hljs-keyword">Delete</span> remote r) <span class="hljs-keyword">Rename</span> remote c) Copy remote s) <span class="hljs-keyword">Set</span> configuration <span class="hljs-keyword">password</span> q) Quit config e/n/d/r/c/s/q> n # 选择n,新建 <span class="hljs-keyword">name</span>> remote # 输入名称,类似于标签,用于区分不同的网盘。 <span class="hljs-keyword">Type</span> <span class="hljs-keyword">of</span> <span class="hljs-keyword">storage</span> <span class="hljs-keyword">to</span> configure. Enter a <span class="hljs-keyword">string</span> value. Press Enter <span class="hljs-keyword">for</span> the <span class="hljs-keyword">default</span> (<span class="hljs-string">""</span>). <span class="hljs-keyword">Choose</span> a <span class="hljs-built_in">number</span> <span class="hljs-keyword">from</span> below, <span class="hljs-keyword">or</span> <span class="hljs-keyword">type</span> <span class="hljs-keyword">in</span> your own <span class="hljs-keyword">value</span> [snip] XX / Microsoft OneDrive <span class="hljs-string">"onedrive"</span> [snip] <span class="hljs-keyword">Storage</span>>XX # 选择Microsoft OneDrive对应的数字 Microsoft App <span class="hljs-keyword">Client</span> <span class="hljs-keyword">Id</span> Leave blank normally. Enter a <span class="hljs-keyword">string</span> value. Press Enter <span class="hljs-keyword">for</span> the <span class="hljs-keyword">default</span> (<span class="hljs-string">""</span>). client_id> # 留空,回车 Microsoft App <span class="hljs-keyword">Client</span> Secret Leave blank normally. Enter a <span class="hljs-keyword">string</span> value. Press Enter <span class="hljs-keyword">for</span> the <span class="hljs-keyword">default</span> (<span class="hljs-string">""</span>). client_secret> # 留空,回车 Edit <span class="hljs-keyword">advanced</span> config? (y/n) y) Yes n) <span class="hljs-keyword">No</span> y/n> n # 选n Remote config <span class="hljs-keyword">Use</span> <span class="hljs-keyword">auto</span> config? * Say Y <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> sure * Say N <span class="hljs-keyword">if</span> you <span class="hljs-keyword">are</span> working <span class="hljs-keyword">on</span> a remote <span class="hljs-keyword">or</span> headless machine y) Yes n) <span class="hljs-keyword">No</span> y/n> n # 选n <span class="hljs-keyword">For</span> this <span class="hljs-keyword">to</span> <span class="hljs-keyword">work</span>, you will need rclone available <span class="hljs-keyword">on</span> a machine that has a web browser available. <span class="hljs-keyword">Execute</span> the <span class="hljs-keyword">following</span> <span class="hljs-keyword">on</span> your machine: rclone authorize <span class="hljs-string">"onedrive"</span> <span class="hljs-keyword">Then</span> paste the <span class="hljs-keyword">result</span> below: <span class="hljs-keyword">result</span>> {<span class="hljs-string">"XXXXXXXX"</span>} # 复制上面Win下获取的token值到这里 <span class="hljs-keyword">Choose</span> a <span class="hljs-built_in">number</span> <span class="hljs-keyword">from</span> below, <span class="hljs-keyword">or</span> <span class="hljs-keyword">type</span> <span class="hljs-keyword">in</span> an existing <span class="hljs-keyword">value</span> <span class="hljs-number">1</span> / OneDrive Personal <span class="hljs-keyword">or</span> Business <span class="hljs-string">"onedrive"</span> <span class="hljs-number">2</span> / Sharepoint site <span class="hljs-string">"sharepoint"</span> <span class="hljs-number">3</span> / <span class="hljs-keyword">Type</span> <span class="hljs-keyword">in</span> driveID <span class="hljs-string">"driveid"</span> <span class="hljs-number">4</span> / <span class="hljs-keyword">Type</span> <span class="hljs-keyword">in</span> SiteID <span class="hljs-string">"siteid"</span> <span class="hljs-number">5</span> / <span class="hljs-keyword">Search</span> a Sharepoint site <span class="hljs-string">"search"</span> Your choice> <span class="hljs-number">1</span> # 这里问你要选择的类型,选<span class="hljs-number">1</span> <span class="hljs-keyword">Found</span> <span class="hljs-number">1</span> drives, please <span class="hljs-keyword">select</span> the one you want <span class="hljs-keyword">to</span> <span class="hljs-keyword">use</span>: <span class="hljs-number">0</span>: OneDrive (business) <span class="hljs-keyword">id</span>=b!Eqwertyuiopasdfghjklzxcvbnm<span class="hljs-number">-7</span>mnbvcxzlkjhgfdsapoiuytrewqk Chose drive <span class="hljs-keyword">to</span> <span class="hljs-keyword">use</span>:> <span class="hljs-number">0</span> # 程序找到网盘,编号是什么数字就填什么数字,一般是<span class="hljs-number">0</span> <span class="hljs-keyword">Found</span> drive <span class="hljs-string">root</span> <span class="hljs-keyword">of</span> <span class="hljs-keyword">type</span> <span class="hljs-string">business</span>, <span class="hljs-keyword">URL</span>: https://org-my.sharepoint.com/personal/you/Documents <span class="hljs-keyword">Is</span> that okay? y) Yes n) <span class="hljs-keyword">No</span> y/n> y <span class="hljs-comment">--------------------</span> [remote] <span class="hljs-keyword">type</span> = onedrive token = {<span class="hljs-string">"access_token"</span>:<span class="hljs-string">"youraccesstoken"</span>,<span class="hljs-string">"token_type"</span>:<span class="hljs-string">"Bearer"</span>,<span class="hljs-string">"refresh_token"</span>:<span class="hljs-string">"yourrefreshtoken"</span>,<span class="hljs-string">"expiry"</span>:<span class="hljs-string">"2021-12-07T09:39:52.486512262+08:00"</span>} drive_id = b!Eqwertyuiopasdfghjklzxcvbnm<span class="hljs-number">-7</span>mnbvcxzlkjhgfdsapoiuytrewqk drive_type = business <span class="hljs-comment">--------------------</span> y) Yes this <span class="hljs-keyword">is</span> OK e) Edit this remote d) <span class="hljs-keyword">Delete</span> this remote y/e/d> y # 选y <span class="hljs-keyword">Current</span> remotes: <span class="hljs-keyword">Name</span> <span class="hljs-keyword">Type</span> ==== ==== remote onedrive e) Edit existing remote n) <span class="hljs-keyword">New</span> remote d) <span class="hljs-keyword">Delete</span> remote r) <span class="hljs-keyword">Rename</span> remote c) Copy remote s) <span class="hljs-keyword">Set</span> configuration <span class="hljs-keyword">password</span> q) Quit config e/n/d/r/c/s/q> q # 选q,退出e) Edit existing remote n) New remote d) Delete remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config e/n/d/r/c/s/q> n # 选择n,新建 name> remote # 输入名称,类似于标签,用于区分不同的网盘。 Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Microsoft OneDrive "onedrive" [snip] Storage>XX # 选择Microsoft OneDrive对应的数字 Microsoft App Client Id Leave blank normally. Enter a string value. Press Enter for the default (""). client_id> # 留空,回车 Microsoft App Client Secret Leave blank normally. Enter a string value. Press Enter for the default (""). client_secret> # 留空,回车 Edit advanced config? (y/n) y) Yes n) No y/n> n # 选n Remote config Use auto config? * Say Y if not sure * Say N if you are working on a remote or headless machine y) Yes n) No y/n> n # 选n For this to work, you will need rclone available on a machine that has a web browser available. Execute the following on your machine: rclone authorize "onedrive" Then paste the result below: result> {"XXXXXXXX"} # 复制上面Win下获取的token值到这里 Choose a number from below, or type in an existing value 1 / OneDrive Personal or Business "onedrive" 2 / Sharepoint site "sharepoint" 3 / Type in driveID "driveid" 4 / Type in SiteID "siteid" 5 / Search a Sharepoint site "search" Your choice> 1 # 这里问你要选择的类型,选1 Found 1 drives, please select the one you want to use: 0: OneDrive (business) id=b!Eqwertyuiopasdfghjklzxcvbnm-7mnbvcxzlkjhgfdsapoiuytrewqk Chose drive to use:> 0 # 程序找到网盘,编号是什么数字就填什么数字,一般是0 Found drive root of type business, URL: https://org-my.sharepoint.com/personal/you/Documents Is that okay? y) Yes n) No y/n> y -------------------- [remote] type = onedrive token = {"access_token":"youraccesstoken","token_type":"Bearer","refresh_token":"yourrefreshtoken","expiry":"2021-12-07T09:39:52.486512262+08:00"} drive_id = b!Eqwertyuiopasdfghjklzxcvbnm-7mnbvcxzlkjhgfdsapoiuytrewqk drive_type = business -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y # 选y Current remotes: Name Type ==== ==== remote onedrive e) Edit existing remote n) New remote d) Delete remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config e/n/d/r/c/s/q> q # 选q,退出
至此,Rclone 已成功连接到了 OneDrive 网盘。
与 OneDrive 不同的是,Google Drive 不需要本地 Windows 客户端预先进行授权获取 token,而是在配置过程中进行授权。
输入以下命令
<span class="hljs-attribute">rclone</span> config<span class="hljs-attribute">rclone</span> configrclone config
会出现以下信息,参照下面的注释进行操作。
TIPS: 因为 RCLONE 会时不时进行更新,当你看到这篇教程时菜单选项可能已经发生了略微的改动,但大致思路不会变,不要无脑照搬操作。
No remotes found - make a new onen) New remoter) <span class="hljs-keyword">Rename</span> remotec) Copy remotes) <span class="hljs-keyword">Set</span> configuration <span class="hljs-keyword">password</span>q) Quit confign/r/c/s/q> n # 选择n,新建<span class="hljs-keyword">name</span>> Google # 输入名称,类似于标签,用于区分不同的网盘。<span class="hljs-keyword">Type</span> <span class="hljs-keyword">of</span> <span class="hljs-keyword">storage</span> <span class="hljs-keyword">to</span> configure.<span class="hljs-keyword">Choose</span> a <span class="hljs-built_in">number</span> <span class="hljs-keyword">from</span> below, <span class="hljs-keyword">or</span> <span class="hljs-keyword">type</span> <span class="hljs-keyword">in</span> your own <span class="hljs-keyword">value</span>[snip]XX / Google Drive<span class="hljs-string">"drive"</span>[snip]<span class="hljs-keyword">Storage</span>>XX # 选择Google Drive对应的数字Google Application <span class="hljs-keyword">Client</span> <span class="hljs-keyword">Id</span> - leave blank normally.client_id> # 留空,回车Google Application <span class="hljs-keyword">Client</span> Secret - leave blank normally.client_secret> # 留空,回车<span class="hljs-keyword">Scope</span> that rclone should <span class="hljs-keyword">use</span> <span class="hljs-keyword">when</span> requesting <span class="hljs-keyword">access</span> <span class="hljs-keyword">from</span> drive.<span class="hljs-keyword">Choose</span> a <span class="hljs-built_in">number</span> <span class="hljs-keyword">from</span> below, <span class="hljs-keyword">or</span> <span class="hljs-keyword">type</span> <span class="hljs-keyword">in</span> your own <span class="hljs-keyword">value</span><span class="hljs-number">1</span> / <span class="hljs-keyword">Full</span> <span class="hljs-keyword">access</span> all files, <span class="hljs-keyword">excluding</span> Application <span class="hljs-keyword">Data</span> Folder.<span class="hljs-string">"drive"</span><span class="hljs-number">2</span> / <span class="hljs-keyword">Read</span>-<span class="hljs-keyword">only</span> <span class="hljs-keyword">access</span> <span class="hljs-keyword">to</span> <span class="hljs-keyword">file</span> metadata <span class="hljs-keyword">and</span> <span class="hljs-keyword">file</span> contents.<span class="hljs-string">"drive.readonly"</span>/ <span class="hljs-keyword">Access</span> <span class="hljs-keyword">to</span> files created <span class="hljs-keyword">by</span> rclone only.<span class="hljs-number">3</span> | These <span class="hljs-keyword">are</span> <span class="hljs-keyword">visible</span> <span class="hljs-keyword">in</span> the drive website.| <span class="hljs-keyword">File</span> authorization <span class="hljs-keyword">is</span> revoked <span class="hljs-keyword">when</span> the <span class="hljs-keyword">user</span> deauthorizes the app.<span class="hljs-string">"drive.file"</span>/ Allows <span class="hljs-keyword">read</span> <span class="hljs-keyword">and</span> write <span class="hljs-keyword">access</span> <span class="hljs-keyword">to</span> the Application <span class="hljs-keyword">Data</span> folder.<span class="hljs-number">4</span> | This <span class="hljs-keyword">is</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">visible</span> <span class="hljs-keyword">in</span> the drive website.<span class="hljs-string">"drive.appfolder"</span>/ Allows <span class="hljs-keyword">read</span>-<span class="hljs-keyword">only</span> <span class="hljs-keyword">access</span> <span class="hljs-keyword">to</span> <span class="hljs-keyword">file</span> metadata but<span class="hljs-number">5</span> | does <span class="hljs-keyword">not</span> <span class="hljs-keyword">allow</span> <span class="hljs-keyword">any</span> <span class="hljs-keyword">access</span> <span class="hljs-keyword">to</span> <span class="hljs-keyword">read</span> <span class="hljs-keyword">or</span> download <span class="hljs-keyword">file</span> content.<span class="hljs-string">"drive.metadata.readonly"</span><span class="hljs-keyword">scope</span>> <span class="hljs-number">1</span> # 选择<span class="hljs-number">1</span><span class="hljs-keyword">ID</span> <span class="hljs-keyword">of</span> the root folder - leave blank normally. Fill <span class="hljs-keyword">in</span> <span class="hljs-keyword">to</span> <span class="hljs-keyword">access</span> <span class="hljs-string">"Computers"</span> folders. (see docs).root_folder_id> # 留空,回车Service <span class="hljs-keyword">Account</span> Credentials <span class="hljs-keyword">JSON</span> <span class="hljs-keyword">file</span> <span class="hljs-keyword">path</span> - needed <span class="hljs-keyword">only</span> <span class="hljs-keyword">if</span> you want <span class="hljs-keyword">use</span> SA instead <span class="hljs-keyword">of</span> interactive login.service_account_file> # 留空,回车Remote config<span class="hljs-keyword">Use</span> <span class="hljs-keyword">auto</span> config?* Say Y <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> sure* Say N <span class="hljs-keyword">if</span> you <span class="hljs-keyword">are</span> working <span class="hljs-keyword">on</span> a remote <span class="hljs-keyword">or</span> headless machine <span class="hljs-keyword">or</span> Y didn<span class="hljs-string">t worky) Yesn) Noy/n>n # 选nIf your browser doesn</span>t <span class="hljs-keyword">open</span> automatically <span class="hljs-keyword">go</span> <span class="hljs-keyword">to</span> the <span class="hljs-keyword">following</span> <span class="hljs-keyword">link</span>: <span class="hljs-keyword">http</span>://<span class="hljs-number">127.0</span><span class="hljs-number">.0</span><span class="hljs-number">.1</span>:<span class="hljs-number">53682</span>/auth<span class="hljs-keyword">Log</span> <span class="hljs-keyword">in</span> <span class="hljs-keyword">and</span> authorize rclone <span class="hljs-keyword">for</span> <span class="hljs-keyword">access</span>Waiting <span class="hljs-keyword">for</span> code...Got codeConfigure this <span class="hljs-keyword">as</span> a <span class="hljs-keyword">Shared</span> Drive (Team Drive)?y) Yesn) <span class="hljs-keyword">No</span>y/n> y # 选n<span class="hljs-comment">--------------------</span>[remote]client_id =client_secret =<span class="hljs-keyword">scope</span> = driveroot_folder_id =service_account_file =token = {<span class="hljs-string">"access_token"</span>:<span class="hljs-string">"XXX"</span>,<span class="hljs-string">"token_type"</span>:<span class="hljs-string">"Bearer"</span>,<span class="hljs-string">"refresh_token"</span>:<span class="hljs-string">"XXX"</span>,<span class="hljs-string">"expiry"</span>:<span class="hljs-string">"2014-03-16T13:57:58.955387075Z"</span>}<span class="hljs-comment">--------------------</span>y) Yes this <span class="hljs-keyword">is</span> OKe) Edit this remoted) <span class="hljs-keyword">Delete</span> this remotey/e/d> y<span class="hljs-keyword">Current</span> remotes:<span class="hljs-keyword">Name</span> <span class="hljs-keyword">Type</span>==== ====Google driveremote onedrivee) Edit existing remoten) <span class="hljs-keyword">New</span> remoted) <span class="hljs-keyword">Delete</span> remoter) <span class="hljs-keyword">Rename</span> remotec) Copy remotes) <span class="hljs-keyword">Set</span> configuration <span class="hljs-keyword">password</span>q) Quit confige/n/d/r/c/s/q> qNo remotes found - make a new one n) New remote r) <span class="hljs-keyword">Rename</span> remote c) Copy remote s) <span class="hljs-keyword">Set</span> configuration <span class="hljs-keyword">password</span> q) Quit config n/r/c/s/q> n # 选择n,新建 <span class="hljs-keyword">name</span>> Google # 输入名称,类似于标签,用于区分不同的网盘。 <span class="hljs-keyword">Type</span> <span class="hljs-keyword">of</span> <span class="hljs-keyword">storage</span> <span class="hljs-keyword">to</span> configure. <span class="hljs-keyword">Choose</span> a <span class="hljs-built_in">number</span> <span class="hljs-keyword">from</span> below, <span class="hljs-keyword">or</span> <span class="hljs-keyword">type</span> <span class="hljs-keyword">in</span> your own <span class="hljs-keyword">value</span> [snip] XX / Google Drive <span class="hljs-string">"drive"</span> [snip] <span class="hljs-keyword">Storage</span>>XX # 选择Google Drive对应的数字 Google Application <span class="hljs-keyword">Client</span> <span class="hljs-keyword">Id</span> - leave blank normally. client_id> # 留空,回车 Google Application <span class="hljs-keyword">Client</span> Secret - leave blank normally. client_secret> # 留空,回车 <span class="hljs-keyword">Scope</span> that rclone should <span class="hljs-keyword">use</span> <span class="hljs-keyword">when</span> requesting <span class="hljs-keyword">access</span> <span class="hljs-keyword">from</span> drive. <span class="hljs-keyword">Choose</span> a <span class="hljs-built_in">number</span> <span class="hljs-keyword">from</span> below, <span class="hljs-keyword">or</span> <span class="hljs-keyword">type</span> <span class="hljs-keyword">in</span> your own <span class="hljs-keyword">value</span> <span class="hljs-number">1</span> / <span class="hljs-keyword">Full</span> <span class="hljs-keyword">access</span> all files, <span class="hljs-keyword">excluding</span> Application <span class="hljs-keyword">Data</span> Folder. <span class="hljs-string">"drive"</span> <span class="hljs-number">2</span> / <span class="hljs-keyword">Read</span>-<span class="hljs-keyword">only</span> <span class="hljs-keyword">access</span> <span class="hljs-keyword">to</span> <span class="hljs-keyword">file</span> metadata <span class="hljs-keyword">and</span> <span class="hljs-keyword">file</span> contents. <span class="hljs-string">"drive.readonly"</span> / <span class="hljs-keyword">Access</span> <span class="hljs-keyword">to</span> files created <span class="hljs-keyword">by</span> rclone only. <span class="hljs-number">3</span> | These <span class="hljs-keyword">are</span> <span class="hljs-keyword">visible</span> <span class="hljs-keyword">in</span> the drive website. | <span class="hljs-keyword">File</span> authorization <span class="hljs-keyword">is</span> revoked <span class="hljs-keyword">when</span> the <span class="hljs-keyword">user</span> deauthorizes the app. <span class="hljs-string">"drive.file"</span> / Allows <span class="hljs-keyword">read</span> <span class="hljs-keyword">and</span> write <span class="hljs-keyword">access</span> <span class="hljs-keyword">to</span> the Application <span class="hljs-keyword">Data</span> folder. <span class="hljs-number">4</span> | This <span class="hljs-keyword">is</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">visible</span> <span class="hljs-keyword">in</span> the drive website. <span class="hljs-string">"drive.appfolder"</span> / Allows <span class="hljs-keyword">read</span>-<span class="hljs-keyword">only</span> <span class="hljs-keyword">access</span> <span class="hljs-keyword">to</span> <span class="hljs-keyword">file</span> metadata but <span class="hljs-number">5</span> | does <span class="hljs-keyword">not</span> <span class="hljs-keyword">allow</span> <span class="hljs-keyword">any</span> <span class="hljs-keyword">access</span> <span class="hljs-keyword">to</span> <span class="hljs-keyword">read</span> <span class="hljs-keyword">or</span> download <span class="hljs-keyword">file</span> content. <span class="hljs-string">"drive.metadata.readonly"</span> <span class="hljs-keyword">scope</span>> <span class="hljs-number">1</span> # 选择<span class="hljs-number">1</span> <span class="hljs-keyword">ID</span> <span class="hljs-keyword">of</span> the root folder - leave blank normally. Fill <span class="hljs-keyword">in</span> <span class="hljs-keyword">to</span> <span class="hljs-keyword">access</span> <span class="hljs-string">"Computers"</span> folders. (see docs). root_folder_id> # 留空,回车 Service <span class="hljs-keyword">Account</span> Credentials <span class="hljs-keyword">JSON</span> <span class="hljs-keyword">file</span> <span class="hljs-keyword">path</span> - needed <span class="hljs-keyword">only</span> <span class="hljs-keyword">if</span> you want <span class="hljs-keyword">use</span> SA instead <span class="hljs-keyword">of</span> interactive login. service_account_file> # 留空,回车 Remote config <span class="hljs-keyword">Use</span> <span class="hljs-keyword">auto</span> config? * Say Y <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> sure * Say N <span class="hljs-keyword">if</span> you <span class="hljs-keyword">are</span> working <span class="hljs-keyword">on</span> a remote <span class="hljs-keyword">or</span> headless machine <span class="hljs-keyword">or</span> Y didn<span class="hljs-string">t work y) Yes n) No y/n>n # 选n If your browser doesn</span>t <span class="hljs-keyword">open</span> automatically <span class="hljs-keyword">go</span> <span class="hljs-keyword">to</span> the <span class="hljs-keyword">following</span> <span class="hljs-keyword">link</span>: <span class="hljs-keyword">http</span>://<span class="hljs-number">127.0</span><span class="hljs-number">.0</span><span class="hljs-number">.1</span>:<span class="hljs-number">53682</span>/auth <span class="hljs-keyword">Log</span> <span class="hljs-keyword">in</span> <span class="hljs-keyword">and</span> authorize rclone <span class="hljs-keyword">for</span> <span class="hljs-keyword">access</span> Waiting <span class="hljs-keyword">for</span> code... Got code Configure this <span class="hljs-keyword">as</span> a <span class="hljs-keyword">Shared</span> Drive (Team Drive)? y) Yes n) <span class="hljs-keyword">No</span> y/n> y # 选n <span class="hljs-comment">--------------------</span> [remote] client_id = client_secret = <span class="hljs-keyword">scope</span> = drive root_folder_id = service_account_file = token = {<span class="hljs-string">"access_token"</span>:<span class="hljs-string">"XXX"</span>,<span class="hljs-string">"token_type"</span>:<span class="hljs-string">"Bearer"</span>,<span class="hljs-string">"refresh_token"</span>:<span class="hljs-string">"XXX"</span>,<span class="hljs-string">"expiry"</span>:<span class="hljs-string">"2014-03-16T13:57:58.955387075Z"</span>} <span class="hljs-comment">--------------------</span> y) Yes this <span class="hljs-keyword">is</span> OK e) Edit this remote d) <span class="hljs-keyword">Delete</span> this remote y/e/d> y <span class="hljs-keyword">Current</span> remotes: <span class="hljs-keyword">Name</span> <span class="hljs-keyword">Type</span> ==== ==== Google drive remote onedrive e) Edit existing remote n) <span class="hljs-keyword">New</span> remote d) <span class="hljs-keyword">Delete</span> remote r) <span class="hljs-keyword">Rename</span> remote c) Copy remote s) <span class="hljs-keyword">Set</span> configuration <span class="hljs-keyword">password</span> q) Quit config e/n/d/r/c/s/q> qNo remotes found - make a new one n) New remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config n/r/c/s/q> n # 选择n,新建 name> Google # 输入名称,类似于标签,用于区分不同的网盘。 Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Google Drive "drive" [snip] Storage>XX # 选择Google Drive对应的数字 Google Application Client Id - leave blank normally. client_id> # 留空,回车 Google Application Client Secret - leave blank normally. client_secret> # 留空,回车 Scope that rclone should use when requesting access from drive. Choose a number from below, or type in your own value 1 / Full access all files, excluding Application Data Folder. "drive" 2 / Read-only access to file metadata and file contents. "drive.readonly" / Access to files created by rclone only. 3 | These are visible in the drive website. | File authorization is revoked when the user deauthorizes the app. "drive.file" / Allows read and write access to the Application Data folder. 4 | This is not visible in the drive website. "drive.appfolder" / Allows read-only access to file metadata but 5 | does not allow any access to read or download file content. "drive.metadata.readonly" scope> 1 # 选择1 ID of the root folder - leave blank normally. Fill in to access "Computers" folders. (see docs). root_folder_id> # 留空,回车 Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login. service_account_file> # 留空,回车 Remote config Use auto config? * Say Y if not sure * Say N if you are working on a remote or headless machine or Y didnt work y) Yes n) No y/n>n # 选n If your browser doesnt open automatically go to the following link: http://127.0.0.1:53682/auth Log in and authorize rclone for access Waiting for code... Got code Configure this as a Shared Drive (Team Drive)? y) Yes n) No y/n> y # 选n -------------------- [remote] client_id = client_secret = scope = drive root_folder_id = service_account_file = token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2014-03-16T13:57:58.955387075Z"} -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Current remotes: Name Type ==== ==== Google drive remote onedrive e) Edit existing remote n) New remote d) Delete remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config e/n/d/r/c/s/q> q
至此,Rclone 已成功连接到了 Google Drive 网盘。
<span class="hljs-selector-tag">rclone</span> <span class="hljs-selector-attr">[功能选项]</span> <本地路径> <网盘名称:路径> <span class="hljs-selector-attr">[参数]</span> <span class="hljs-selector-attr">[参数]</span> ...<span class="hljs-selector-tag">rclone</span> <span class="hljs-selector-attr">[功能选项]</span> <本地路径> <网盘名称:路径> <span class="hljs-selector-attr">[参数]</span> <span class="hljs-selector-attr">[参数]</span> ...rclone [功能选项] <本地路径> <网盘名称:路径> [参数] [参数] ...
<span class="hljs-selector-tag">rclone</span> <span class="hljs-selector-attr">[功能选项]</span> <网盘名称:路径> <本地路径> <span class="hljs-selector-attr">[参数]</span> <span class="hljs-selector-attr">[参数]</span> ...<span class="hljs-selector-tag">rclone</span> <span class="hljs-selector-attr">[功能选项]</span> <网盘名称:路径> <本地路径> <span class="hljs-selector-attr">[参数]</span> <span class="hljs-selector-attr">[参数]</span> ...rclone [功能选项] <网盘名称:路径> <本地路径> [参数] [参数] ...
<span class="hljs-selector-tag">rclone</span> <span class="hljs-selector-attr">[功能选项]</span> <网盘名称:路径> <网盘名称:路径> <span class="hljs-selector-attr">[参数]</span> <span class="hljs-selector-attr">[参数]</span> ...<span class="hljs-selector-tag">rclone</span> <span class="hljs-selector-attr">[功能选项]</span> <网盘名称:路径> <网盘名称:路径> <span class="hljs-selector-attr">[参数]</span> <span class="hljs-selector-attr">[参数]</span> ...rclone [功能选项] <网盘名称:路径> <网盘名称:路径> [参数] [参数] ...
示例:
<span class="hljs-attribute">rclone</span> move -v /files ftp:/files --transfers=<span class="hljs-number">1</span><span class="hljs-attribute">rclone</span> move -v /files ftp:/files --transfers=<span class="hljs-number">1</span>rclone move -v /files ftp:/files --transfers=1
rclone 有 4 个级别的日志记录,ERROR,NOTICE,INFO 和 DEBUG。默认情况下,rclone 将生成 ERROR 和 NOTICE 级别消息。
使用 --log-file=FILE 选项,rclone 会将 Error,Info 和 Debug 消息以及标准错误重定向到 FILE,这里的 FILE 是你指定的日志文件路径。
另一种方法是使用系统的指向命令,比如:
<span class="hljs-attribute">rclone</span> sync -v Onedrive:/DRIVEX Gdrive:/DRIVEX > <span class="hljs-string">"~/DRIVEX.log"</span> <span class="hljs-number">2</span>>&<span class="hljs-number">1</span><span class="hljs-attribute">rclone</span> sync -v Onedrive:/DRIVEX Gdrive:/DRIVEX > <span class="hljs-string">"~/DRIVEX.log"</span> <span class="hljs-number">2</span>>&<span class="hljs-number">1</span>rclone sync -v Onedrive:/DRIVEX Gdrive:/DRIVEX > "~/DRIVEX.log" 2>&1
比如 --exclude "*.bak"、--filter "- *.bak",排除所有 bak 文件。也可以写作。
比如 --include "*.{png,jpg}"、--filter "+ *.{png,jpg}",包含所有 png 和 jpg 文件,排除其他文件。
--delete-excluded 删除排除的文件。需配合过滤参数使用,否则无效。
目录过滤需要在目录名称后面加上 /,否则会被当做文件进行匹配。以 / 开头只会匹配根目录(指定目录下),否则匹配所目录。这同样适用于文件。
默认大小单位为 kBytes ,但可以使用 k ,M 或 G 后缀。
rclone 中的每个选项都可以通过环境变量设置。环境变量的名称可以通过长选项名称进行转换,删除 -- 前缀,更改 - 为 _,大写并添加前缀 RCLONE_。环境变量的优先级会低于命令行选项,即通过命令行追加相应的选项时会覆盖环境变量设定的值。
比如设置最小上传大小 --min-size 50,使用环境变量是 RCLONE_MIN_SIZE=50。当环境变量设置后,在命令行中使用 --min-size 100,那么此时环境变量的值就会被覆盖。
给Aria2服务器所用的SSL证书往往不支持Aria2所使用的6800端口,而80/443端口还要提供HTTP服务,为此就需要用Nginx来实现同时提供HTTP和Aria2 JSONRPC服务了。
修改Aria2配置文件
<span class="hljs-comment">#允许所有来源, web界面跨域权限需要</span><span class="hljs-attr">rpc-allow-origin-all</span>=<span class="hljs-literal">false</span><span class="hljs-comment">#允许非外部访问</span><span class="hljs-attr">rpc-listen-all</span>=<span class="hljs-literal">false</span><span class="hljs-comment">#RPC端口, 仅当默认端口被占用时修改</span><span class="hljs-attr">rpc-listen-port</span>=<span class="hljs-number">6800</span><span class="hljs-comment">#允许所有来源, web界面跨域权限需要</span> <span class="hljs-attr">rpc-allow-origin-all</span>=<span class="hljs-literal">false</span> <span class="hljs-comment">#允许非外部访问</span> <span class="hljs-attr">rpc-listen-all</span>=<span class="hljs-literal">false</span> <span class="hljs-comment">#RPC端口, 仅当默认端口被占用时修改</span> <span class="hljs-attr">rpc-listen-port</span>=<span class="hljs-number">6800</span>#允许所有来源, web界面跨域权限需要 rpc-allow-origin-all=false #允许非外部访问 rpc-listen-all=false #RPC端口, 仅当默认端口被占用时修改 rpc-listen-port=6800
<span class="hljs-comment">#ARIA2</span><span class="hljs-attribute">location</span> /jsonrpc {<span class="hljs-attribute">proxy_pass</span> http://localhost:6800/jsonrpc;<span class="hljs-attribute">proxy_redirect</span> <span class="hljs-literal">off</span>;<span class="hljs-attribute">proxy_set_header</span> X-Real-IP <span class="hljs-variable">$remote_addr</span>;<span class="hljs-attribute">proxy_set_header</span> X-Forwarded-For <span class="hljs-variable">$proxy_add_x_forwarded_for</span>;<span class="hljs-attribute">proxy_set_header</span> Host <span class="hljs-variable">$host</span>;<span class="hljs-comment">#以下代码使支持WebSocket</span><span class="hljs-attribute">proxy_http_version</span> <span class="hljs-number">1</span>.<span class="hljs-number">1</span>;<span class="hljs-attribute">proxy_set_header</span> Upgrade <span class="hljs-variable">$http_upgrade</span>;<span class="hljs-attribute">proxy_set_header</span> Connection <span class="hljs-string">"upgrade"</span>;}<span class="hljs-comment">#ARIA2</span> <span class="hljs-attribute">location</span> /jsonrpc { <span class="hljs-attribute">proxy_pass</span> http://localhost:6800/jsonrpc; <span class="hljs-attribute">proxy_redirect</span> <span class="hljs-literal">off</span>; <span class="hljs-attribute">proxy_set_header</span> X-Real-IP <span class="hljs-variable">$remote_addr</span>; <span class="hljs-attribute">proxy_set_header</span> X-Forwarded-For <span class="hljs-variable">$proxy_add_x_forwarded_for</span>; <span class="hljs-attribute">proxy_set_header</span> Host <span class="hljs-variable">$host</span>; <span class="hljs-comment">#以下代码使支持WebSocket</span> <span class="hljs-attribute">proxy_http_version</span> <span class="hljs-number">1</span>.<span class="hljs-number">1</span>; <span class="hljs-attribute">proxy_set_header</span> Upgrade <span class="hljs-variable">$http_upgrade</span>; <span class="hljs-attribute">proxy_set_header</span> Connection <span class="hljs-string">"upgrade"</span>; }#ARIA2 location /jsonrpc { proxy_pass http://localhost:6800/jsonrpc; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; #以下代码使支持WebSocket proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; }
其中 location /jsonrpc 表示设置好后RPC地址为 //example.com/jsonrpc
这样做还有一个好处,那就是不需要单独为Aria2 RPC服务器设置密码验证了。认证直接靠nginx完成,能见到webui就能连上ARIA2 RPC
本套织梦模板采用织梦最新内核开发的模板,这款模板使用范围广,不仅仅局限于一类型的企业,政府部门、单位机构类的网站都可以用该模板。你只需要把图片和文章内容换成你的即可,颜色都可以修改,改完让你耳目一新的感觉!布局规整,利于用户体验,手工书写DIV+CSS,代码精简。 同一个后台管理 三网合一简单方便,体验好! 1、该模板代码干净整洁; 2、效果相当的炫酷,相当简洁大气高端,模板简单,全部已…
源码介绍: 123网盘解析PHP版本源码是一种非常实用的工具,可以方便地帮助用户在网页上直接解析出其它网站中的资源,并提供下载链接。当用户需要获取某些资源时,往往需要通过各种搜索引擎或者专业的资源网站进行查找,而且很多时候找到了资源链接后还需要进行各种繁琐的操作才能完成下载。而使用 123网盘解析PHP版本源码,只需在相关网站上找到资源链接,然后粘贴到 123网盘解析PHP版本源码中进行解析,即可…
123网盘解析PHP版本源码是一种非常实用的工具,可以方便地帮助用户在网页上直接解析出其它网站中的资源,并提供下载链接。当用户需要获取某些资源时,往往需要通过各种搜索引擎或者专业的资源网站进行查找,而且很多时候找到了资源链接后还需要进行各种繁琐的操作才能完成下载。而使用 123网盘解析PHP版本源码,只需在相关网站上找到资源链接,然后粘贴到 123网盘解析PHP版本源码中进行解析,即可获…
不是学生也能参与,但是年龄必须在16~24岁之间! 1、微信扫码进入->按照提示填写->然后点击开通->支付1.99元即可->开完后去黑鲸会员->全部权益查看! 2、开通后立得20元无门槛打车/火车/酒店券 3选1!更多详细权益进去后下拉到底点黑鲸会员协议查看!各种出行优惠刚需还挺不错的! 一年内肯定能用上 暑假出行旅游、回家都刚好用得着,1块…
简介:最新1元云购源码】购啊购一元微购+带机器人+带控制+购啊购云购电商管理系统源码简介与安装说明:不带授权,带机器人,有控制,带教程,十几分钟就能部署起来。最近感觉云购热度有点高,不知道是不是因为境内高频彩全军覆没导致的。这个算是擦边球的类型吧(虽然印象里好像也是踩红线),也不失为一条出路。最近热度比较高,大家随行就市吧,好像最近要多语言的比较多。有心人,可以现在开始改一套多语言的出来,也许就能…
2019_SWAPIDC最新模板 使用方法:上传根目录/temples 解压即可 下载连接(复制直接下载) https://wp.123vo.cn/index/share/code/Y3iieuJNqd 内容看完了…