centos 挂载 onedirve
程序员文章站
2024-03-15 23:22:24
...
挂载onedrive需要浏览器登录授权,而centos一般作为服务器使用,额米有界面,需要先在windows上使用rclone获取授权**,然后在centos上完成挂载。
获取授权**
-
下载rclone window版本
从rclone download下载对应的win版本rclone
-
下载后解压,并从命令行运行
rclone authorize "onedrive"
。 -
在自动打开的浏览器中登录,登录后会跳转到授权成功的页面。授权成功后回到CMD窗口,会看到如下:
-
把{}括号里面的内容复制下来保存好,后面需要用到(包含括号一起复制保存)
centos挂载onedrive
软件安装
- 安装rclone
curl https://rclone.org/install.sh | sudo bash
- 安装fuse
yum install fuse
rclone配置
-
启动配置
rclone config
-
创建一个新配置
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> onedrive-chuqidecha # 这里自己输入名字
-
选择需要挂载的网盘
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 Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc) \ "s3" 5 / Backblaze B2 \ "b2" 6 / Box \ "box" 7 / Cache a remote \ "cache" 8 / Citrix Sharefile \ "sharefile" 9 / Dropbox \ "dropbox" 10 / Encrypt/Decrypt a remote \ "crypt" 11 / FTP Connection \ "ftp" 12 / Google Cloud Storage (this is not Google Drive) \ "google cloud storage" 13 / Google Drive \ "drive" 14 / Google Photos \ "google photos" 15 / Hubic \ "hubic" 16 / In memory object storage system. \ "memory" 17 / JottaCloud \ "jottacloud" 18 / Koofr \ "koofr" 19 / Local Disk \ "local" 20 / Mail.ru Cloud \ "mailru" 21 / Mega \ "mega" 22 / Microsoft Azure Blob Storage \ "azureblob" 23 / Microsoft OneDrive \ "onedrive" 24 / OpenDrive \ "opendrive" 25 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH) \ "swift" 26 / Pcloud \ "pcloud" 27 / Put.io \ "putio" 28 / QingCloud Object Storage \ "qingstor" 29 / SSH/SFTP Connection \ "sftp" 30 / Sugarsync \ "sugarsync" 31 / Transparently chunk/split large files \ "chunker" 32 / Union merges the contents of several remotes \ "union" 33 / Webdav \ "webdav" 34 / Yandex Disk \ "yandex" 35 / http Connection \ "http" 36 / premiumize.me \ "premiumizeme" Storage> 23 #这里onedrive是23,不同的rclone版本数字可能不同
-
client_id和client_scret不用管,直接留空
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 (default) 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 (default) 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 (same rclone version recommended) : rclone authorize "onedrive" Then paste the result below: result> # 这里输入windows下获取的**
-
选择类型为onedrive
Choose a number from below, or type in an existing value 1 / OneDrive Personal or Business \ "onedrive" 2 / Root Sharepoint site \ "sharepoint" 3 / Type in driveID \ "driveid" 4 / Type in SiteID \ "siteid" 5 / Search a Sharepoint site \ "search" Your choice> 1 # 选择onedrive
-
选择驱动
Found 1 drives, please select the one you want to use: 0: (personal) id=7e574746be4c2c00 Chose drive to use:> 0 # 这里只有个人版,输入0
-
确认并退出配置
Found drive 'root' of type 'personal', URL: https://onedrive.live.com/?cid=7e574746be4c2c00 Is that okay? y) Yes (default) n) No y/n> y # 确认选择 -------------------- [onedrive-chuqidecha] type = onedrive token = {"access_token":"这里是**,省略"} drive_id = 7e574746be4c2c00 drive_type = personal -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y # 如果配置没问题,继续确认 Current remotes: Name Type ==== ==== onedrive-chuqidecha 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 # 退出配置
挂载
-
创建挂载目录
mkdir -p /netdisk/onedrive-chuqidecha
-
后台挂载
nohup rclone mount DriveName:Folder LocalFolder --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000 > logs/log.log 2>&1 &
-
DriveName
为初始化配置填的`name`` - ``Folder
为
OneDrive`里的文件夹 -
LocalFolder
为本地挂载的目标目录
-
-
检查是否挂载成功
df -h
卸载
fusermount -qzu LocalFolder
推荐阅读
-
centos 挂载 onedirve
-
CentOS 6 SSH 免密登录
-
CentOS 基础知识 Shell 基础教程1-21
-
centos yum 安装mysql 博客分类: linux数据库
-
Centos下解压rar、zip文件的方法 博客分类: centos rar 解压 centos rar
-
整理基础的CentOS常用命令 博客分类: centos centos命令
-
centos单机安装Hadoop2.9 博客分类: hadoop hadoop
-
整理基础的CentOS常用命令 博客分类: centos centos命令
-
Centos下解压rar、zip文件的方法 博客分类: centos rar 解压 centos rar
-
centos单机安装Hadoop2.9 博客分类: hadoop hadoop