-
-
Notifications
You must be signed in to change notification settings - Fork 871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Overwrite oldest file #2879
Comments
The older file already gets overwritten if the file is older and the content is different. If the older file content is the same, the older timestamp is corrected. If the older file generates a conflict, it gets renamed. Please review the documentation. |
How can I get this? I also tried
|
Correct the local file is renamed to avoid data loss aa per the application output. This functionality is there to ensure you do not suffer data loss and the integrity of your data is maintained. Overwriting the local file would consitute data loss - and what you want to do is intentionally have data loss. |
I guess. Basically, when there is a conflict, I want the older file to get replaced by the newer one. In a sense an option to control over conflicts. My problem is with duplication and this scenario is the cause. Also, I'm also still confused about |
Using inotify can significantly improve performance and synchronization by enabling real-time, local monitoring of file changes. With inotify, files can be immediately uploaded when changes are detected, reducing the delay typically required to check for cloud updates. However, resource consumption should be carefully monitored to ensure efficient usage. If resource utilization remains comparable to that of OneDrive on Windows, this approach would be highly effective. |
The client already uses inotify when in |
Specifically for this, that is a bug looking at the code. The application , when it hits this section:
should not do this IF |
@BEST8OY First install all the require platform dependencies to build the client on your respective platforms. Please read https://github.com/abraunegg/onedrive/blob/master/docs/install.md#building-from-source---high-level-requirements and then follow correctly for your platform. Once this is done, to clone the PR to resolve your issue, you can use a script like the following:
This script will create a local folder called To run the PR, you need to run the client from the PR build directory:
To install the PR, you will need to perform When running the PR, your version should be: In addition to this, please read: |
Thanks for the effort.
Here is the scenario
[hl@DIAMOND ~/OD-Test/onedrive-pr2967]$ ./onedrive -s --local-first --dry-run
Reading configuration file: /home/hl/.config/onedrive/config
Configuration file successfully loaded
D-Bus message bus daemon is available; GUI notifications are now enabled
DRY-RUN Configured. Output below shows what 'would' have occurred.
DRY-RUN: Copying items.sqlite3 to items-dryrun.sqlite3 to use for dry run operations
DRY RUN: Not creating backup config file as --dry-run has been used
DRY RUN: Not updating hash files as --dry-run has been used
Using IPv4 and IPv6 (if configured) for all network operations
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Configuring Global Azure AD Endpoints
WARNING: Application has been configured to bypass local data preservation in the event of file conflict.
WARNING: Local data loss MAY occur in this scenario.
Performing a database consistency and integrity check on locally stored data ..
Changed local items to upload to Microsoft OneDrive: 1
Uploading modified file: Notes/Brain/test.md ... done
Scanning the local file system '~/OneDrive' for new data to upload .
Fetching items from the OneDrive API for Drive ID: 5a69b9216e4e0694 ..
Processing 3 applicable changes and items received from Microsoft OneDrive .
Number of items to download from Microsoft OneDrive: 1
The local file to replace (Notes/Brain/test.md) has been modified locally since the last download. Renaming it to avoid potential local data loss.
WARNING: Local Data Protection has been disabled - not renaming local file. You may experience data loss on this file: Notes/Brain/test.md
Downloading file: Notes/Brain/test.md ... done
Sync with Microsoft OneDrive is complete
Attempting to perform a database vacuum to optimise database
Database vacuum is complete
[hl@DIAMOND ~/OD-Test/onedrive-pr2967]$ ./onedrive -s --local-first
Reading configuration file: /home/hl/.config/onedrive/config
Configuration file successfully loaded
D-Bus message bus daemon is available; GUI notifications are now enabled
Using IPv4 and IPv6 (if configured) for all network operations
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Configuring Global Azure AD Endpoints
WARNING: Application has been configured to bypass local data preservation in the event of file conflict.
WARNING: Local data loss MAY occur in this scenario.
Performing a database consistency and integrity check on locally stored data ..
Changed local items to upload to Microsoft OneDrive: 1
Uploading modified file: Notes/Brain/test.md ... done
Scanning the local file system '~/OneDrive' for new data to upload ..
Fetching items from the OneDrive API for Drive ID: 5a69b9216e4e0694 .
Processing 3 applicable changes and items received from Microsoft OneDrive .
Sync with Microsoft OneDrive is complete
Attempting to perform a database vacuum to optimise database
Database vacuum is complete |
When using So the online OneDrive data is not changed - thus, when using that option it will still send you the online file in its existing state. |
I know what I was about to be misled by the |
Okay I missed |
Great ! |
Given your testing, you can confirm this issue is resolved ? |
Yes. Resloved! |
Thanks |
Merged fix into master |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Is your feature request related to a problem? Please describe.
Yes
I use my phone (android) and my Linux setup to sync with onedrive.
So, imagine this scenario
Describe the solution you'd like
If I set
bypass_data_preservation
as true, it will use the file from 2 and disregard the file from 3But What I want to happen is to not have two files and also the file from 3 replace the one from 2
Describe alternatives you've considered
An option like
overwrite_oldest_file
would be niceWhat does this do? the file that has older timestamp will be replaced with the newer one.
Additional context
No sync is done in PC between 2 and 3
The text was updated successfully, but these errors were encountered: