Another way to authenticate rclone with OneDrive

What is the problem you are having with rclone?

I need to backup my university files (~1TB) from Google Drive (Education Workspace) to my uni's OneDrive but my I'm assuming that our Azure AD does not have rclone as a trusted application thus it would not return a token and configuring OneDrive in rclone fails.

A solution I came up with was to just use the OneDrive desktop app and rclone copy to the local OneDrive directory so it will automatically upload. But I quickly ran out of space since I am running rclone on a VPS.

Run the command 'rclone version' and share the full output of the command.

rclone v1.58.1
- os/version: Microsoft Windows Server 2019 Standard 1809 (64 bit)
- os/kernel: 10.0.17763.1935 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.17.9
- go/linking: dynamic
- go/tags: cmount

Which cloud storage system are you using? (eg Google Drive)

Destination: OneDrive
Origin: Google Drive

I would like to ask if there is another way to get an auth token from OneDrive so that I could use rclone.
or if that's not possible, a way to automatically delete uploaded files inside the local OneDrive directory.

Thank you.

On your desktop, could you rclone mount your gdrive (eg as drive X:) and then add x:\ to your list of files sync'd in the desktop OneDrive App?

Hey @sweh ! Thank you for this suggestion. Will try this now

Hello, unfortunately I still can't sync even using the method you mentioned.

I mounted my GDrive to X:\ using rclone mount gdrive:\ x:\ but I can't point OneDrive to sync the drive directly, instead I would have to copy files into the OneDrive directory for it to sync. This causes the out of disk space problem as well.

However, I did find a way to point a folder outside of the OneDrive directory to be synced using a junction link using mklink /j but it still did not work as OneDrive could not scan for any changes.

Any thoughts?

Other than getting a 1Tb external drive (maybe $50 or so), I can't think of anything off the top of my head.

Yea, I'm now kinda accepting that I can't automate this backup considering the consequences of restricted API access. Thanks for the help again!

Did you try it?

Note that you can set up rclone to speak webdav to a sharepoint endpoint which sometimes works around these auth problems: see the webdav sharepoint docs and the section after that on sharepoint with NTLM auth may help also.

1 Like

If the above tips from Nick doesn’t help then I guess OneDrive will automatically free space for you if you enable “Files On-demand” in your OneDrive client settings and ensure “always keep on this device” is disabled for your top upload folder.

Otherwise, you may have to manually “free space” each time you are getting near the limit.

More information in this Microsoft support article:

Thank you @ncw ! This is just what I was looking for. I tried it now and it works flawlessly! My uni uses Office365 Education and not a self-hosted Sharepoint so I didn't need the additional NTLM auth step.

Thanks again for the help!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.