Loading... ## 1. 安装配置Rclone ## **下载Rclone** ``` curl https://rclone.org/install.sh | bash apt-get install fuse -y ``` <!--more--> **获取Token** 需要[下载地址][1]下载本地Rclone。终端/命令提示符(CMD)进入下载文件夹,运行命令 ``` rclone authorize "onedrive" ``` 在跳出的网页中登录账号、授权,最后会在终端/命令提示符(CMD)出现Token ``` Paste the following into your remote machine ---> {"access_token":"eyJ0eXAiO...","expiry":"2022-02-10T15:51:36.937194+08:00"} <---End paste ``` **配置Rclone** ``` rclone config ``` ``` No remotes found - make a new one n) New remote s) Set configuration password q) Quit config n/s/q> n ``` 输入`n`,新建 ``` name> onedrive ``` 名称,随意输入 ``` Option Storage. 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. 1 / 1Fichier \ "fichier" 2 / Alias for an existing remote \ "alias" 3 / Amazon Drive \ "amazon cloud drive" 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, SeaweedFS, and Tencent COS \ "s3" 5 / Backblaze B2 \ "b2" 6 / Better checksums for other remotes \ "hasher" 7 / Box \ "box" 8 / Cache a remote \ "cache" 9 / Citrix Sharefile \ "sharefile" 10 / Compress a remote \ "compress" 11 / Dropbox \ "dropbox" 12 / Encrypt/Decrypt a remote \ "crypt" 13 / Enterprise File Fabric \ "filefabric" 14 / FTP Connection \ "ftp" 15 / Google Cloud Storage (this is not Google Drive) \ "google cloud storage" 16 / Google Drive \ "drive" 17 / Google Photos \ "google photos" 18 / Hadoop distributed file system \ "hdfs" 19 / Hubic \ "hubic" 20 / In memory object storage system. \ "memory" 21 / Jottacloud \ "jottacloud" 22 / Koofr \ "koofr" 23 / Local Disk \ "local" 24 / Mail.ru Cloud \ "mailru" 25 / Mega \ "mega" 26 / Microsoft Azure Blob Storage \ "azureblob" 27 / Microsoft OneDrive \ "onedrive" 28 / OpenDrive \ "opendrive" 29 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH) \ "swift" 30 / Pcloud \ "pcloud" 31 / Put.io \ "putio" 32 / QingCloud Object Storage \ "qingstor" 33 / SSH/SFTP Connection \ "sftp" 34 / Sia Decentralized Cloud \ "sia" 35 / Sugarsync \ "sugarsync" 36 / Tardigrade Decentralized Cloud Storage \ "tardigrade" 37 / Transparently chunk/split large files \ "chunker" 38 / Union merges the contents of several upstream fs \ "union" 39 / Uptobox \ "uptobox" 40 / Webdav \ "webdav" 41 / Yandex Disk \ "yandex" 42 / Zoho \ "zoho" 43 / http Connection \ "http" 44 / premiumize.me \ "premiumizeme" 45 / seafile \ "seafile" Storage> 27 ``` 找到onedrive,输入序号 ``` Option client_id. OAuth Client Id. Leave blank normally. Enter a string value. Press Enter for the default (""). client_id> ``` 回车,留空 ``` Option client_secret. OAuth Client Secret. Leave blank normally. Enter a string value. Press Enter for the default (""). client_secret> ``` 回车,留空 ``` Option region. Choose national cloud region for OneDrive. Enter a string value. Press Enter for the default ("global"). Choose a number from below, or type in your own value. 1 / Microsoft Cloud Global \ "global" 2 / Microsoft Cloud for US Government \ "us" 3 / Microsoft Cloud Germany \ "de" 4 / Azure and Office 365 operated by 21Vianet in China \ "cn" region> 1 ``` 选择onedrive区域 ``` Edit advanced config? y) Yes n) No (default) y/n> n ``` 输入`n` ``` Use auto config? * Say Y if not sure * Say N if you are working on a remote or headless machine y) Yes (default) n) No y/n> n ``` 输入`n` ``` Option config_token. For this to work, you will need rclone available on a machine that has a web browser available. For more help and alternate methods see: https://rclone.org/remote_setup/ Execute the following on the machine with the web browser (same rclone version recommended): rclone authorize "onedrive" Then paste the result. Enter a string value. Press Enter for the default (""). config_token> ``` 输入刚刚获取的Token ``` Type of connection Enter a string value. Press Enter for the default ("onedrive"). Choose a number from below, or type in an existing value. 1 / OneDrive Personal or Business \ "onedrive" 2 / Root Sharepoint site \ "sharepoint" / Sharepoint site name or URL 3 | E.g. mysite or https://contoso.sharepoint.com/sites/mysite \ "url" 4 / Search for a Sharepoint site \ "search" 5 / Type in driveID (advanced) \ "driveid" 6 / Type in SiteID (advanced) \ "siteid" / Sharepoint server-relative path (advanced) 7 | E.g. /teams/hr \ "path" config_type> 1 ``` 输入账号类型 ``` Found drive "root" of type "business" URL: https://icverify-my.sharepoint.com/personal/qinyz910_icverify_onmicrosoft_com/Documents y) Yes (default) n) No y/n> y ``` 输入`y` ``` drive_type = business -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y ``` 输入`y` ``` Name Type ==== ==== onedrive 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 ls onedrive: ``` 若出现onedirve目录,则表示成功 ## 安装并配置aria2 ## 安装aria2 [官方地址][2] ``` apt install wget curl ca-certificates wget -N git.io/aria2.sh && chmod +x aria2.sh ./aria2.sh ``` ``` 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]:1 ``` 输入`1`安装 **配置自动上传脚本** ``` # 网盘名称(RCLONE 配置时填写的 name) drive-name=onedrive # 网盘目录(上传目标目录,网盘中的文件夹路径)。注释或留空为网盘根目录,末尾不要有斜杠。 #drive-dir=/DRIVEX/Download ``` 编辑aria2.conf文件, ``` vim /root/.aria2c/aria2.conf ``` 将`on-download-complete=/root/.aria2c/clean.sh`换成`on-download-complete=/root/.aria2c/upload.sh` ``` # 此项未定义则执行 下载停止后执行的命令 (on-download-stop) on-download-complete=/root/.aria2c/upload.sh ``` 下载文件[tracker.sh][3]到/root/.aria2c/目录下,并运行 ``` wget https://raw.githubusercontent.com/P3TERX/aria2.conf/master/tracker.sh /root/.aria2c chmod +x tracker.sh && ./tracker.sh ``` **重启aria2** ``` /etc/init.d/aria2 restart ``` [1]: https://rclone.org/downloads/ [2]: https://github.com/P3TERX/aria2.sh [3]: https://raw.githubusercontent.com/P3TERX/aria2.conf/master/tracker.sh 最后修改:2022 年 02 月 10 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 如果觉得我的文章对你有用,请随意赞赏