macos上安装mysql8 macos上安装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 /home/ftp -o user=username:password
参数说明
#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
直接使用官方的一键安装命令即可,输入下面的命令:
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 &