Backup Onedrive

otpi

Contributor
Joined
Feb 23, 2017
Messages
117
How do I best proceed to create regular backups of my onedrive? I use it for all sorts of files, and since I have this great nas in my basement, why not have a backup of those files... just in case. My plan is to create a dataset for onedrive, regular syncs from onedrive to this dataset, and setup snapshots at desired intervals. I was thinking daily download of onedrive files, and bi-weekly snapshots kept for 3-4 months.

My search-fu came up with many ways trying to backup nas to onedrive, but I want to do it the other way. Well, search-fu indicates syncs go both ways(?). Also, rsync and rclone are things to investigate? But I have no experience with these tools.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Is your OneDrive configuration already synced to a folder on your computer automatically?
If that's true, you can use Microsoft SyncToy to sync those files to another location. SyncToy can be scheduled.
 

otpi

Contributor
Joined
Feb 23, 2017
Messages
117
I have used synctoy previously. It is an option. I was hoping a there was an easy direct route (NAS<->Onedrive). And, I (think) would like to avoid a local copy on my desktop. Sounds weird I guess, right? But my Onedrive is setup on my work laptop, and I rarely bring it home. My desktop is mostly used for fun'n'games, which also leaves it open for the kids...

So, rclone is the thing (https://rclone.org/onedrive/ ). Is there a plugin for rclone? I'm guessing a jail is the way forward?

I found this issue, anyone know if it was ever resolved?
 

Mlovelace

Guru
Joined
Aug 19, 2014
Messages
1,111
So, rclone is the thing (https://rclone.org/onedrive/ ). Is there a plugin for rclone? I'm guessing a jail is the way forward?

I found this issue, anyone know if it was ever resolved?
You would want to run rclone in a jail.

As for the issue the other person was seeing I couldn't say, they would need to file a bug with the rclone people.

I have been using rclone for google cloud storage as well as google drive for over two years and haven't had an issue.
 

otpi

Contributor
Joined
Feb 23, 2017
Messages
117

Ok, that looks easy enough (Provided I get the login credentials etc working).

For backing up I just create a pull cloud-sync task. I assume that will keep my backup identical to my Onedrive? i.e. if I create/delete files the same changes should occur on my backup whenever I set the Pull to happen.

I have been using rclone for google cloud storage as well as google drive for over two years and haven't had an issue.
That's reassuring. Have you ever tested with Onedrive? Does login credential have to be updated regularly, or is it fire and forget?

Also, does Onedrive have application passwords like google accounts? I use those for freenas and pfsense emails.

Outside of my planned scope, but: If I also want to push changes. Is it just a case of adding a push cloud sync task? If I set it to push every 10 s, will it do anything if there has been no changes (i.e. will I be spamming my Onedrive, or is it just checking for changes and doing nothing, if none has occured)?
 

garm

Wizard
Joined
Aug 19, 2017
Messages
1,556
No clue, you need to test it out. Remember you have snapshots
 

otpi

Contributor
Joined
Feb 23, 2017
Messages
117
Well.

Under [system]->[cloud credentials]->[add] there is an option for Onedrive and "personal" (I'm guessing this is correct for a 365 license).
Undre [Tasks]->[Cloud Sync tasks] i added a pull using the credentials with "folder" blank and "target" to my new (windows) dataset

Having some trouble getting the correct access token. Should I do as per https://rclone.org/onedrive/ and add an app https://apps.dev.microsoft.com/#/appList ?

afaik, the access token should be on the form, including {}:
{"access_token":"youraccesstoken","token_type":"Bearer","refresh_token":"yourrefreshtoken","expiry":"2018-08-26T22:39:52.486512262+08:00"}

I did try to work around rclone and use Chrome -> Inspect to get the acces_token from the request header. didn't work... or I did something wrong. And I did some testes with https://docs.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/msa-oauth , it's above me...
 
Last edited:
Top