FreeNAS Sync to Onedrive with Cloud Sync on FreeNAS

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I just re-ran the process on my Beta2 box and confirm sync worked. In case it makes some kind of difference, I used the legacy UI to add the cloud credential and the sync task.

Also a note, I used "onedrive" as the name for the cloud credential in the UI and also in the name requested by the rclone config CLI.
 

nathank1989

Contributor
Joined
Aug 29, 2016
Messages
103
I just re-ran the process on my Beta2 box and confirm sync worked. In case it makes some kind of difference, I used the legacy UI to add the cloud credential and the sync task.
It might be the timing, since I was trial and error-ing the Token key, it may have expired before I got it right. I'll try again once I get home and see if it works
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I've yet to work out if the short expiry is just for the setup process and not for the token itself (I hope that's what the refresh_token part of the token is about), since re-doing the rclone config every day would be a deal breaker on using this.
 

nathank1989

Contributor
Joined
Aug 29, 2016
Messages
103
The token expires relatively quickly... you may need to generate another one.

Make sure you take everything including the curly braces (but stopping at that) from the result out of rclone config

Nope, just did the rclone token and pasted it directly into the credential and ran the task, twice, both time still the same refresh_token not valid error...

Does it matter if it is OneDrive for business/Personal? The one drive I have is through an O365 account, not a microsoft account. Would that matter?

Also, I, too, am using the legacy UI.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I have only tested with a personal account so far. I will try with a business account tomorrow and see if it gives me the same error.
 

nathank1989

Contributor
Joined
Aug 29, 2016
Messages
103
It seems to be because it's a OneDrive for Business account. I set up a microsoft account to test and the task ran without error. This does not work for my use case, so I will have to find a workaround.
I haven't tried an azure blob, but I'd rather do OneDrive since I'm already paying for the space.
 

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179
Right so to clarify how this works, in order to set up one drive via the GUI, I open the Cloud Cred page do all that, then to get the access token I need to run rclone config and follow said instructions so that I get the access token, do I then paste just the access token into the field in the GUI, or all of the contents of the curly brackets? And is it a MUST that I continue with the rclone config on the CLI ASWELL, or is that JUST to get the access token and nothing else? @sretalla

Also forgot to add, with OneDrive do i need to specify PULL or PUSH, and if i want it to properly sync do i need to set up both
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Everything in the curly braces is the token.
You only get the token at the end, so nothing more should be required if you set up a cloud sync job in the GUI
Push sends data to the cloud, pull gets it from the cloud... you need to specify what you want to happen.
 

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179
Everything in the curly braces is the token.
You only get the token at the end, so nothing more should be required if you set up a cloud sync job in the GUI
Push sends data to the cloud, pull gets it from the cloud... you need to specify what you want to happen.
Yep, managed to get it all working, thanks for that. The only issue im now having is im trying to set up my Uni onedrive but when trying to login to get the OAuth token for my uni Microsoft email account I need to login via the Uni site as Microsofts normal login page doesnt recognise xxxxxx@surrey.ac.uk. Is there a way of manually getting an OAuth token?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Not sure if your academic account will offer the option, but in O365 business, users can generate app passwords, which may be the path to what's needed there to handle the oauth token.
 

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179
Not sure if your academic account will offer the option, but in O365 business, users can generate app passwords, which may be the path to what's needed there to handle the oauth token.
Yeh im going to look into manually adding apps using Microsoft graph, so far though its just said I dont have permission, so I might contact the IT dept and see whats up
 

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179
Having a new issue with the cloud sync with OneDrive now, basically because the PUSH and PULL tasks are done separately im finding when I add files so say my OneDrive, the server will do its hourly PUSH which will delete the new files ive added to OneDrive before the server has had a chance to PULL them from OneDrive, even if I were to swap the tasks round to go PULL->PUSH instead of PUSH->PULL id get the same problem with files being added to the server getting deleted too. Is there not a way to use the cloud sync in the same way that for example that the Windows OneDrive Client works where its essentially merging the Server and OneDrive every hour so files on both get synced. Instead of what it is now where I had some work basically straight up deleted ahaha.

EDIT - I cant tell if its an issue with how I've set it up, or its a bug or just an oversight when it was implemented?
 

Gen8 Runner

Contributor
Joined
Aug 5, 2015
Messages
103
Hey everyone,
is this now working for anyone?

I setup a Linux VM, just to get by rclone the token, but always get the message "Failed to configure OneDrive: invalid character ':' after top-level value ". I tried every part of the token-string to get working, but no success.

Everything between the {..........}, everything before and behind the ":" etc. etc.

Really awful setup for this, i thought that at least Microsoft would offer a comfortable WebUI, to get the credentials.
With Backblaze i already got it working, but why should i pay for it, if storage is already included in Office365?
 

dmo90

Cadet
Joined
Apr 17, 2020
Messages
1
Hey everyone,
is this now working for anyone?

I setup a Linux VM, just to get by rclone the token, but always get the message "Failed to configure OneDrive: invalid character ':' after top-level value ". I tried every part of the token-string to get working, but no success.

Everything between the {..........}, everything before and behind the ":" etc. etc.

I ran into the same issue.
In my case I had to copy the curly brackets, too.

e.g.
Code:
{"access_token":"eyJ0ovL3N0cy53aW5kb3d.....mlmN26mRcrVxZq","token_type":"Bearer","refresh_token":"xxxxxx.....blBE1Tdf","expiry":"2020-01-11T11:11:11.111111111+01:00"}
 

MrWaste

Cadet
Joined
Sep 11, 2020
Messages
3
The One drive cloud credentials are not working. I have done what @dmo90 said to do and it doesn't give me error for that part. However, when I press "Login to Provider" The Drive ID doesn't get fill in! Left bank. If I remove parts of the
{"access_token":"eyJ0ovL3N0cy53aW5kb3d.....mlmN26mRcrVxZq","token_type":"Bearer","refresh_token":"xxxxxx.....blBE1Tdf","expiry":"2020-01-11T11:11:11.111111111+01:00"}
it gives an error. So I know that's right for sure.

Next Step watching a Youtube Video. Link Below. I copied everything how they did it and still doesn't work. I didn't copy their credentials... What am I doing wrong?
I also tried copying the Drive ID from command prompt with the "Login to Provider" to fill the blank in and doesn't work.

I need help please, I am stuck!



Proof:
Proof.png


Youtube Video I watched and did everything Exact:
 

elorimer

Contributor
Joined
Aug 26, 2019
Messages
194
With the rclone config screen open, copy the whole access token (including curly brackets, and paste it into the access token field. Right below it on the rclone config screen, copy the drive id and paste it into the drive id field. Use the pull down to set the drive type (personal/business), then verify credential and save.
 

MrWaste

Cadet
Joined
Sep 11, 2020
Messages
3
@elorimer

I have already done that.. It some reason doesn't want to work. I have a feeling its the Drive Id because I can't get it from the "Login to Provider" screen.
I copied everything how it should be and still nothing :(

Proof:

2020-09-11_134747.png
 

MrWaste

Cadet
Joined
Sep 11, 2020
Messages
3
I copied {"access_token":"EwB4A to xx7jAg$$","expiry":"2020-09-10T16:17:42.3748429-07:00"}
Then Copied the Drive ID
Set it to personal.

Save and this:
2020-09-11_140214.png
 

elorimer

Contributor
Joined
Aug 26, 2019
Messages
194
I don't know what you mean by "I can't get it from the "Login to Provider" screen. That erases the drive id and drive type for me.

I think you just want to verify credential and save.
 

Gen8 Runner

Contributor
Joined
Aug 5, 2015
Messages
103
The One drive cloud credentials are not working. I have done what @dmo90 said to do and it doesn't give me error for that part. However, when I press "Login to Provider" The Drive ID doesn't get fill in! Left bank. If I remove parts of the
{"access_token":"eyJ0ovL3N0cy53aW5kb3d.....mlmN26mRcrVxZq","token_type":"Bearer","refresh_token":"xxxxxx.....blBE1Tdf","expiry":"2020-01-[...]

You're doing it too complicated.
Open your FreeNAS Webpage. System -> Cloud Credentials -> Add -> Enter a Name -> Choose Microsoft OneDrive -> DO NOT ENTER ANY DATA BY HAND -> Press "Login to Provider" Button -> Popup-Opens -> Login on the Microsoft-Page which appears in the PopUp -> All your data is inserted automatically.
That's it!

Just btw.:
I would NOT recommend using OneCloud for FreeNAS.
The simple-reason: OneDrive has a limited file-name length (I think it was 400 characters). If they're exceeded, files will not be synced anymore to OneDrive. I don't know, why Microsoft is still using this limitation, for me makes absoloutely no sense anymore in 2020, but that's the (not changeable) fact. For that reason: No One-Drive anymore for me.
 
Top