https://rclone.org/onedrive/

1. 在有图形界面的机器上面授权

下载rclone https://rclone.org/downloads/

//授权
rclone authorize "onedrive"

rclone

2. 在vps上面安装rclone

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

2.1 设置

rclone config
//查看目录
rclone lsd drivename: 

3. 挂载到vps的目录上

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

rclone mount od:vps /root/onedrive --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000 --daemon
df -h 查看挂载的网盘


config

[email protected]:~/rclone# rclone config
2019/07/31 15:52:12 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> od(自己随意起的名字)
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

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
y/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
n) No
y/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":"xxx","expiry":"xxx"}
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
Found 1 drives, please select the one you want to use:
0: OneDrive (business) id=b!Of6hJqCR10OtkBAStqG9NfdOUerTm2pEvyVypngHFmIGApjwLLTWS4ooCCcgVSf5
Chose drive to use:> 0
Found drive 'root' of type 'business', URL: https://mjj138-my.sharepoint.com/personal/hwl_star_us_org/Documents
Is that okay?
y) Yes
n) No
y/n> y


y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:

Name                 Type
====                 ====
od                   onedrive

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config

q