How to monitor both local and server changes? #1754
-
Firstly, thank you for your work on such a useful package. My issue is that I am uncertain about how to best set up a continual For context, my use case is that I have two laptops from which I want to edit the same set of notes. I'm unlikely to be using both to edit the notes at the same time, but I want each laptop to 'pull' from the OneDrive server any previous changes made from the other laptop upon startup, and continually 'push' any local changes while I'm editing the notes. I just want to achieve this in a robust, simple way. As I understand it, I've read docs/USAGE.md#use-webhook-to-subscribe-to-remote-updates-in-monitor-mode, and it seemed to address my use case by implementing 'event-based' downloading from the server. Long story short, I tried installing I'm wondering if the following is simplest solution to my use case: Upon startup of either laptop, run I apologise for any naivety here. I really did try to work this out myself from the docs and look through previous issues, but I couldn't find the info I needed in a form I could understand. Perhaps the solution to my problem could be included in |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Your understanding is not correct here for In During the 'sync' loop, changes made online are 'downloaded' to the local machine.
This is one way to do things, but is also a sure fire way to screw up your local sync state. Do not use The best solution for you that I can recommend is to have a startup script like you suggested, but containing the following:
The alternative here is for you to use https://github.com/jstaf/onedriver - as this implements the 'on-demand' functionality, meaning you are only ever going to be editing the file as it exists on OneDrive. I do not know how it would handle your scenario (2 systems, editing same file) and how OneDrive will interpret those edits. |
Beta Was this translation helpful? Give feedback.
-
Hi @abraunegg, why doesn't the --monitor do its work by "receiving" push messages, ie when something changes on server, server shall "push" a message to onedrive client instead of client "pulling" if there's change every 300 seconds? This would make downloads from server instant or very minimal delay, since client would be notified. Is there no function in the Onedrive API or not yet implemented? |
Beta Was this translation helpful? Give feedback.
@tom-andersson
Your understanding is not correct here for
--monitor
method of operation.In
--monitor
mode the client will monitor the 'server' for changes, but will only do this at predefined intervals - 300 seconds by default. This value is user configurableDuring the 'sync' loop, changes made online are 'downloaded' to the local machine.