OneDrive integration?

Status
Not open for further replies.

ChrisHolzer

Dabbler
Joined
Apr 6, 2017
Messages
23
Hi there!

My wife, both kids and I use OneDrive on our smartphones to sync pictures and videos we take with it.

Is it possible to somehow have FreeNAS sync the data from all 4 OneDrive accounts to it's local storage so that when we access FreeNAS everyone of us has access to his/her OneDrive data?

like:
\\share\OneDrive\Anita
\\share\OneDrive\Hannah
\\share\OneDrive\David
\\share\OneDrive\Chris

This would be a great solution for us as right now we have to go to the PC, logon with our local user and then wait until onedrive syncs all new pics/videos of just that users. :(
 

zoomzoom

Guru
Joined
Sep 6, 2015
Messages
677
You can do this one of two ways, and I personally recommend the 2nd if it's a laptop, else the OneDrive folder will not reside on the PC.
  1. Each user will need to sign into their PC accounts, sign out of OneDrive Application on the PC, sign back in, then change the sync folder to the appropriate share.

  2. Use a RoboCopy script to monitor the OneDrive folder on the PC, syncing the two directories and monitoring the OneDrive folder on the PC for any changes, then syncing those changes to the network share.

    1. Save the following to: C:\ProgramData\Scripts\Robocopy
      • Remove .txt extension
        • NoShell-OneDrive.vbs
          • Visual Basic Script which calls OneDrive-Sync.bat, allowing it to run without showing a terminal pop up
        • OneDrive-Sync.bat
          • Batch file which calls RoboCopy to sync changes between the local OneDrive folder on the PC and the OneDrive backup on the Network share.
          • Currently set to monitor C:\%USERNAME%\OneDrive for 1 change every 5 minutes. It can also be configured to monitor the Network Share backup for changes and sync those to the local OneDrive folder.
          • You will need to customize the %Dest% variable to point towards the network share path you want the 4 OneDrive folders synced to (1 per user)
        • OneDrive Folder Sync.xml
          • Task Scheduler Task to auto run the two above scripts upon logging into Windows

    2. Import OneDrive Folder Sync.xml into Task Scheduler
      1. WinKey+ R -> tasksched.msc -> OK
      2. Highlight: Task Scheduler Library -> Action -> Enable All Tasks History
      3. Highlight: Task Scheduler Library -> Action -> New Folder
        • Name it whatever you like
      4. Highlight: New folder's name, right-click on it, select Import Task..., then OneDrive Folder Sync.xml
        • Currently, the user for running the task is set to NT AUTHORITY\SYSTEM, however this may need to be changed, depending on whether or not System has write privileges on the FreeNAS share. If it doesn't, you can add SYSTEM r/w privileges to the Network share via the Advanced Security properties tab.
      5. Right click on the the task, select Run
        • Task will auto run upon every boot, starting 5min after log in. Each user must be logged in before the sync for that user will occur
 

Attachments

  • OneDrive-Sync.bat.txt
    1.3 KB · Views: 371
  • NoShell-OneDrive.vbs.txt
    488 bytes · Views: 374
  • OneDrive Folder Sync.xml.txt
    3.9 KB · Views: 380
Last edited:

ChrisHolzer

Dabbler
Joined
Apr 6, 2017
Messages
23
Thank you for your reply, but you miss understood.

I want FreeNAS to sync my OneDrive accounts - on its own.
Like QNAP can.
 

zoomzoom

Guru
Joined
Sep 6, 2015
Messages
677
Highly doubtful since it's not likely Microsoft created a BSD version of OneDrive client software... QNAP runs a Linux OS IIRC.

You could run an Rsync job on the FreeNAS box to sync all changes from the OneDrive folders on the PC, or configure NextCloud (though unless you have an upload speed of >30mbit/s, you'll notice a performance difference when accessing it in comparison to a PC accessing OneDrive over a 60mbit/s+ connection).
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
I might be missing the point here, but isn't the whole purpose of OneDrive (or any other similar service) to store local copies of files in the cloud, whilst keeping multiple local devices in sync?

I can't see how having another copy on FreeNAS provides anything more than an extra backup?

Pretty sure you could achieve what you're looking for using a Windows VM on FreeNAS, but I'm struggling with the why you'd bother!
 

zoomzoom

Guru
Joined
Sep 6, 2015
Messages
677
I could see a use case if one has a laptop but has hundreds of gigs stored on OneDrive, as it would be impractical to keep that amount of files on a typical user's laptop. Having a local cache of all files on a network share would allow faster access to them, especially if the user doesn't have broadband or fiber internet.

Another option would be something similar to SyncTrayzor, which auto syncs files/directories across multiple devices and has a FreeNAS plugin for.
 
Last edited:

zoomzoom

Guru
Joined
Sep 6, 2015
Messages
677
That's awesome, as I never knew a program like that existed =]
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
That's awesome, as I never knew a program like that existed =]
Didn't I tell you about it in the thread about Google Drive, where you said you'd need to set up a VM to use Google Drive? Or was that someone else?

Edit: Ah yes, this thread.
 

zoomzoom

Guru
Joined
Sep 6, 2015
Messages
677
That you did... I had completely forgotten about that =] I've bookmarked it's GitHub page this time around, as that's a pretty cool program.
 

ChrisHolzer

Dabbler
Joined
Apr 6, 2017
Messages
23
I might be missing the point here, but isn't the whole purpose of OneDrive (or any other similar service) to store local copies of files in the cloud, whilst keeping multiple local devices in sync?

I can't see how having another copy on FreeNAS provides anything more than an extra backup?

Pretty sure you could achieve what you're looking for using a Windows VM on FreeNAS, but I'm struggling with the why you'd bother!

When we turn on the PC then we want to instantly have access to all the pictures/videos we made with our phones.

We do not want to wait for the local OneDrive installation on the PC to download/sync everything first, which can very well take more than an hour - keep in mind that we also have to switch users on the PC to get it to sync all 4 OneDrive accounts.

So instead of running the OneDrive client on the PC, we would highly prefer to simply add all 4 OneDrive accounts on FreeNAS so that it constantly syncs these 4 accounts to it's internal storage.

That way we just have to power up the PC and instantly have access to all our OneDrive data without sync'ing it first using the PC.

As I mentioned earlier, QNAP provides such a feature: https://www.qnap.com/en/how-to/tuto...ge-smoothly-with-cloud-drive-sync-on-qnap-nas

Would be great if FreeNAS could as well. That way I could avoid to run a VM instance of Windows where I'd have to use "GoodSync" which supports multiple cloud services and multiple users/accounts per service.

*edit*
@danb35 thanks for the rclone tip! I guess with it I can achive what I am after, right? :)
https://rclone.org/onedrive/
 
Last edited:

gpsguy

Active Member
Joined
Jan 22, 2012
Messages
4,472
Status
Not open for further replies.
Top