首页
友情链接
统计
推荐
上网导航
魔逸网盘
号卡购买
Search
1
为你的服务器添加免费的公网IPv6!
518 阅读
2
使用socat进行端口转发
354 阅读
3
Nginx反代cloudflare站点
340 阅读
4
拥有一个自己的私人网盘—Cloudreve(Linux篇)
207 阅读
5
企业网络扩容
159 阅读
默认分类
网络技术
思科模拟器
华为模拟器
企业网络构建
防火墙技术
网站教程
网站源码
登录
/
注册
Search
标签搜索
网络构建
思科模拟器
CISCO
网盘
Linux
Cloudreve
Ubuntu
Centos
bash
子网掩码
ip
网络知识
rclone
OneDrive
Windows
服务器
IPv6
Free
laomoy
累计撰写
17
篇文章
累计收到
9
条评论
首页
栏目
默认分类
网络技术
思科模拟器
华为模拟器
企业网络构建
防火墙技术
网站教程
网站源码
页面
友情链接
统计
推荐
上网导航
魔逸网盘
号卡购买
搜索到
1
篇与
的结果
2023-04-16
linux/windows使用rclone挂载OneDrive等各大网盘
首先去rclone官网下载Windows的安装包 rclone官网下载你自己电脑对应的架构即可,我这里下载 Intel/AMD - 64 Bit Windows安装包。1. 获取Token将你刚刚下好的安装包解压,解压后进入文件夹里 在文件路径地址里直接输入cmd即可快速打开cmd进入rclone的文件夹接着输入如下命令rclone.exe authorize "onedrive"就会弹出微软账号登陆,登陆你自己的账号即可ps:如果输入命令后 没有弹出浏览器,手动打开cmd中的链接 http://127.0.0.1:53682/auth?state=96dCfS5S6tkahZ2abAvq7A(不要照搬我的,每次生成的url都是不一样的)粘贴到浏览器打开会提示授权 允许即可,浏览器返回Success! 表示成功获取到Token,返回cmd中查看整个{}都是Token(包括括号),全部复制出来!2. 在Linux上安装Rclone官网提供了一键脚本curl https://rclone.org/install.sh | bash3. 配置rclone安装完成了以后执行 rclone config[
[email protected]
]# rclone config No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> 我们还没有添加任何网盘的 这里输入n代表New remote 然后会让你备注个名字 随便取个名字,我这里就用onedriven/s/q> n Enter name for new remote. name> onedrive Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. 1 / 1Fichier \ (fichier) 2 / Akamai NetStorage \ (netstorage) 3 / Alias for an existing remote \ (alias) 4 / Amazon Drive \ (amazon cloud drive) 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS, Qiniu and Wasabi \ (s3) 6 / Backblaze B2 \ (b2) 7 / Better checksums for other remotes \ (hasher) 8 / Box \ (box) 9 / Cache a remote \ (cache) 10 / Citrix Sharefile \ (sharefile) 11 / Combine several remotes into one \ (combine) 12 / Compress a remote \ (compress) 13 / Dropbox \ (dropbox) 14 / Encrypt/Decrypt a remote \ (crypt) 15 / Enterprise File Fabric \ (filefabric) 16 / FTP \ (ftp) 17 / Google Cloud Storage (this is not Google Drive) \ (google cloud storage) 18 / Google Drive \ (drive) 19 / Google Photos \ (google photos) 20 / HTTP \ (http) 21 / Hadoop distributed file system \ (hdfs) 22 / HiDrive \ (hidrive) 23 / In memory object storage system. \ (memory) 24 / Internet Archive \ (internetarchive) 25 / Jottacloud \ (jottacloud) 26 / Koofr, Digi Storage and other Koofr-compatible storage providers \ (koofr) 27 / Local Disk \ (local) 28 / Mail.ru Cloud \ (mailru) 29 / Mega \ (mega) 30 / Microsoft Azure Blob Storage \ (azureblob) 31 / Microsoft OneDrive \ (onedrive) 32 / OpenDrive \ (opendrive) 33 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH) \ (swift) 34 / Oracle Cloud Infrastructure Object Storage \ (oracleobjectstorage) 35 / Pcloud \ (pcloud) 36 / Put.io \ (putio) 37 / QingCloud Object Storage \ (qingstor) 38 / SMB / CIFS \ (smb) 39 / SSH/SFTP \ (sftp) 40 / Sia Decentralized Cloud \ (sia) 41 / Storj Decentralized Cloud Storage \ (storj) 42 / Sugarsync \ (sugarsync) 43 / Transparently chunk/split large files \ (chunker) 44 / Union merges the contents of several upstream fs \ (union) 45 / Uptobox \ (uptobox) 46 / WebDAV \ (webdav) 47 / Yandex Disk \ (yandex) 48 / Zoho \ (zoho) 49 / premiumize.me \ (premiumizeme) 50 / seafile \ (seafile) Storage> 我们是onedrive 这里输入31即可client_id,client_secret留空直接回车后面会询问你的位置,选择你onedrive的实际位置即可,我这里选择1,Global全球config_token 粘贴刚刚在电脑上获取的TokenStorage> 31 Option client_id. OAuth Client Id. Leave blank normally. Enter a value. Press Enter to leave empty. client_id> Option client_secret. OAuth Client Secret. Leave blank normally. Enter a value. Press Enter to leave empty. client_secret> Option region. Choose national cloud region for OneDrive. Choose a number from below, or type in your own string value. Press Enter for the default (global). 1 / Microsoft Cloud Global \ (global) 2 / Microsoft Cloud for US Government \ (us) 3 / Microsoft Cloud Germany \ (de) 4 / Azure and Office 365 operated by Vnet Group in China \ (cn) region> 1 Edit advanced config? y) Yes n) No (default) y/n> n Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. y) Yes (default) n) No y/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 value. config_token> 此处粘贴刚刚在电脑上获取的Token选择你onedrive的类型我这里选择1 OneDrive Personal or BusinessOption config_type. Type of connection Choose a number from below, or type in an existing string value. Press Enter for the default (onedrive). 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显示出了你的onedrive信息 这里再选择1 后面的全部回车确认无误就添加成功啦~Option config_driveid. Select drive you want to use Choose a number from below, or type in your own string value. Press Enter for the default (b!1-FforcAiUyto0U-shk-xxxxxxxxxxxxxXk7DQp8ada7ahaSdZBgSLJueIBbrtko). 1 / OneDrive (business) \ (b!1-FforcAiUyto0U-shk-xxxxxxxxxxxxxXk7DQp8ada7ahaSdZBgSLJueIBbrtko) config_driveid> 1 Drive OK? Found drive "root" of type "business" URL: https://xxx-my.sharepoint.com/personal/xxx_xxx_onmicrosoft_com/Documents(这里显示的是微软分配给你的onedrive域名) y) Yes (default) n) No y/n> Configuration complete. Options: - type: onedrive - token: {"access_token":"***此处会显示你的Token信息***","expiry":"2023-04-16T15:45:08.892829573+08:00"} - drive_id: b!1-FforcAiUyto0U-shk-xxxxxxxxxxxxxXk7DQp8ada7ahaSdZBgSLJueIBbrtko - drive_type: business Keep this "onedrive" remote? y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> Current remotes: 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> 4. 挂载onedrive& 代表后台运行rclone mount name:挂载目录 挂载位置#创建本地挂载路径 mkdir -p /home/onedrive #挂载命令示例 rclone mount onedrive:/ /home/onedrive --allow-other --vfs-cache-mode writes --allow-non-empty & # 取消挂载 fusermount -qzu <本地路径>挂载报错报错内容:Fatal error: failed to mount FUSE fs: fusermount: exec: "fusermount": executable file not found in $PATH安装fuse#Centos yum install fuse -y #Debian/Ubuntu apt-get install fuse -y报错内容:Fatal error: failed to mount FUSE fs: fusermount: exec: "fusermount3": executable file not found in $PATH安装fuse3#Centos yum install fuse3 -y #Debian/Ubuntu apt-get install fuse3 -y5. 开机自启rclone重启后就失效了,所以我们还要加个开机自启vi /etc/systemd/system/onedrive.service内容按照如下格式写即可[Unit] Description=onedrive [Service] User=root ExecStart=rclone mount onedrive:/ /home/onedrive --allow-other --vfs-cache-mode writes --allow-non-empty --vfs-cache-max-age 6h --vfs-cache-max-size 10G ExecStop=fusermount -qzu /home/onedrive Restart=on-abort [Install] WantedBy=multi-user.targetsystemctl 常用的命令如下# 开机自启 systemctl enable rclone # 启动 systemctl start rclone # 重启 systemctl restart rclone # 停止 systemctl stop rclone常用指令rclone copy – 复制rclone sync – 同步 将目录内容同步到网盘目录rclone move – 移动 将目录内文件移动到网盘,默认删除路径文件rclone purge – 删除路径及所有文件rclone delete – 删除路径所有文件但不删除路径rclone mkdir – 创建目录rclone rmdir – 删除目录rclone check – 检查目标文件与源文件是否匹配rclone ls – 列出指定路径下的所有的文件以及文件大小rclone lsl – 仅列出对象的修改时间,大小和路径rclone lsd – 仅列出目录rcloen lsf – 以易于解析的格式列出对象和目录rcloen lsjson – 以JSON格式列出对象和目录rclone lsd– 列出路径下的所有目录rclone size – 打印目录中对象的总大小和数量rclone mount – 将远程文件路径挂载到本地路径
2023年04月16日
131 阅读
1 评论
6 点赞