rclone

###在Mac/Centos上使用rclone挂载OneDrive网盘

在这里插入图片描述

说明:我们很多人喜欢用VPS做离线下载,不过由于有的服务器硬盘太小了,装不了太多电影资源啥的,我们就需要想办法了,之前说过可以通过挂载FTP来增大空间。
也可以使用rclone,可以挂载OneDrive/Google Drive/Amazon Drive等云存储,同时还支持全平台,意味着您可以在Windows、Mac OS、Linux上进行使用,本文将讲述挂载FTP,和onedrive,本人在测试googledrive 时会timeout,原因大家都懂得。

前提说明:服务器上CentOS大部分未安装图形界面,但是Rclone必须要在有内置浏览器的电脑才能正常完成授权,因此这里使用的办法是先在本地Windows/Mac电脑安装Rclone并获取授权后的token,再将其复制到CentOS的服务器上。刚好也可以证明支持全平台。

Linux 通过安装curlFTtpFS来挂载FTP

##安装
系统要求 debian Ubantu centos

####1、 安装CurlFtpFS

centos系统

1、yum -y install epel-release && yum -y install curlftpfs

ubantu系统

apt-get install curlftpfs -y

####2、挂载FTP

1、 创建目录,路径及名称
mkdir /home/tmp
2、 挂载FTP
curlftpfs ftp.yourserver.com /home/ftp -o user=username:password

参数说明

ftp.yourserver.com #FTP地址

/home/ftp #本地目录

username #FTP用户名

password #FTP密码

####3、 检查
输入df -h命令查下是否挂载成功

linux 通过rclone挂载onedrive

##mac 安装rclone

默认:在本地mac电脑上下载rclone,下载地址:二进制

通过 Termial 下载

cd && curl -O https://downloads.rclone.org/rclone-current-osx-amd64.zip

解压

unzip -a rclone-current-osx-amd64.zip && cd rclone-*-osx-amd64

移动到相应的位置

sudo mkdir -p /usr/local/bin
sudo mv rclone /usr/local/bin/

##获取TOKEN

初始化配置

rclone config

显示结果

n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> onedrive  #随便填,后面要用到
Type of storage to configure.
Choose a number from below, or type in your own value
 1 / Amazon Drive
   \ "amazon cloud drive"
 2 / Amazon S3 (also Dreamhost, Ceph, Minio)
   \ "s3"
 3 / Backblaze B2
   \ "b2"
 4 / Box
   \ "box"
 5 / Cache a remote
   \ "cache"
 6 / Dropbox
   \ "dropbox"
 7 / Encrypt/Decrypt a remote
   \ "crypt"
 8 / FTP Connection
   \ "ftp"
 9 / Google Cloud Storage (this is not Google Drive)
   \ "google cloud storage"
10 / Google Drive
   \ "drive"
11 / Hubic
   \ "hubic"
12 / Local Disk
   \ "local"
13 / Microsoft Azure Blob Storage
   \ "azureblob"
14 / Microsoft OneDrive
   \ "onedrive"
15 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
   \ "swift"
16 / Pcloud
   \ "pcloud"
17 / QingCloud Object Storage
   \ "qingstor"
18 / SSH/SFTP Connection
   \ "sftp"
19 / Webdav
   \ "webdav"
20 / Yandex Disk
   \ "yandex"
21 / http Connection
   \ "http"
Storage> 14  #选择14,Microsoft OneDrive
Microsoft App Client Id - leave blank normally.
client_id>  #留空 
Microsoft App Client Secret - leave blank normally.
client_secret>  #留空 
Remote config
Choose OneDrive account type?
 * Say b for a OneDrive business account
 * Say p for a personal OneDrive account
b) Business
p) Personal
b/p> p  #这里选择个人版,你想挂载Business就选择b
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> {"access_token":""}   #复制{xx}整个内容,**包括大括号{}**,后面需要用到
--------------------
[Rats]
client_id = 
client_secret = 
token = {"access_token":""}
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y  选择y
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> q  #选择q退出

onedrive大伙可去网上找相关文档申请免费5T

到此 基本算是完成配置,可以尝试在mac挂载

首次挂载会出错,因为mac文件系统原因找不到OSXFUSE

1、 Fatal error: failed to mount FUSE fs: cannot locate OSXFUSE

2、  error: Directory is not empty: /data If you want to mount it anyway use: --allow-non-empty option

3、  mount helper error: mount_osxfuse: failed to mount /onedrive@/dev/osxfuse0: Operation not permitted
 Fatal error: failed to mount FUSE fs: mount_osxfusefs: exit status 71

解决方案:

下载相应的版本
1、osxfuse

2、目录可以重新创建一个

3、目录创建到当前用户下 mac/Users/xxxx

##centos 安装rclone
直接使用官方的一键安装命令即可,输入下面的命令:

curl https://rclone.org/install.sh | sudo bash

CentOS挂载Onedrive

接下来操作方法和mac完全一样,就不重复了,唯一的区别是“Use auto config?”这里选择n,并输入之前获取的token

是否自动配置

  Use auto config?
 * Say Y if not sure
 * Say N if you are working on a remote or headless machine
y) Yes
n) Noy/n> n  #在这里输入nFor this to work, you will need rclone available on a machine that has a web browser available.

输入TOKEN

Execute the following on your machine:
    rclone authorize "onedrive"Then paste the result below:result> {"access_token":""}  #粘贴之前在客户端授权的内容,包括大括号一起粘贴进去

###挂载 OneDrive为磁盘

#新建本地文件夹,路径自己定,即下面的LocalFolder

mkdir /root/OneDrive
#挂载为磁盘

rclone mount DriveName:Folder LocalFolder --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000

DriveName为初始化配置填的name,Folder为oneDrive里的文件夹,可以为/,LocalFolder为centos上的本地文件夹。

###查看挂载情况
df -h

在这里插入图片描述

centos需要下载fuse

#安装fuse

yum -y install fuse

#创建挂载目录

mkdir -p /home/onedrive

#挂载

#如果需要后台保持运行,使用下面的命令

nohup rclone mount remote:path/to/files /home/onedrive &

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据提供的引用内容,我们可以得知用户想要了解rclone nfs的相关信息。rclone是一个命令行程序,可以将本地文件系统与各种云存储服务连接起来。而nfs是一种网络文件系统协议,可以让不同的计算机通过网络共享文件。因此,rclone nfs可以让用户通过nfs协议来访问云存储服务。 以下是使用rclone nfs的步骤: 1. 首先,需要在本地安装rclone。可以通过以下命令在Linux系统上安装rclone: ```shell curl https://rclone.org/install.sh | sudo bash ``` 2. 然后,需要配置rclone以连接到云存储服务。可以通过以下命令来配置rclone: ```shell rclone config ``` 在配置过程中,需要选择nfs作为连接协议,并输入云存储服务的相关信息,例如access key和secret key等。 3. 配置完成后,可以使用以下命令将云存储服务挂载到本地文件系统: ```shell rclone mount remote:path/to/files /path/to/local/mount ``` 其中,remote是rclone配置文件中定义的远程名称,path/to/files是云存储服务中的文件路径,/path/to/local/mount是本地文件系统中的挂载点。 4. 最后,可以使用nfs协议来访问挂载的云存储服务。例如,在另一台计算机上,可以使用以下命令来挂载rclone nfs: ```shell mount -t nfs server:/path/to/mount /path/to/local/mount ``` 其中,server是rclone所在的计算机的IP地址或主机名,/path/to/mount是rclone挂载的路径,/path/to/local/mount是本地文件系统中的挂载点。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值