One Drive mount erases file history on write

Hi!

I mounted my One Drive remote on Linux with:

rclone --vfs-cache-mode writes mount onedrive: "${HOME}/Remote/OneDrive" &

Next i opened a remote .docx file with LibreOffice, edited it and saved. Then i opened the online OneDrive service and i discovered that the history of the file is erased. Actually it seems that updating via mounted drive completely erased the old file and replaced it by the very fresh one.

I'd like to ask if this behavior is intended with rclone? Or maybe i'm doing something wrong. Generally i'd like to keep the file version history...

Regards,
Marek

When you say history of the file, what exactly do you mean? Like a revision history? Or a history of "file edited on x by y"? How do you view that?

I suspect it is the sequence of operations that LibreOffice does that messes with the history somehow.

If you use rclone copy to update a file, does it preserve the history?

By history of the file i mean all versions stored by onedrive service along with the info who made the change. Everythin is cleaned up in the scenario i descrined. The edited file appears as a new one.

I tested also the following: copy file from the mounted drive to other location, then edit and copy back to mounted drive. The result is exactly the same, the copied file appears as a new one...

rclone copy you asked works as expected however: new version of the file is added. Where is the difference then? I prefer mounted drive as this is much more convenient...

BTW: I must mention that i do work in dolphin file manager under KDE, maybe this is the source of the problem?

OK

I suspect that the copy under dolphin does something like

  1. copy file to new name
  2. rename new name to existing name

And it will be step 2 that erases the history.

That's what is going on. However this is not only dolphin. Libreoffice made the same, bacause the file is copied to cache then edited and copied back at file closing. It seems problem is more general: copying files to mounted drive works might work with these two steps you described. Is this possible this is KDE only issue? I checked the command line cp and it is working properly.

It will be very application dependent as to whether it is a problem or not.

It might be possible to preserve the history. This is the API rclone uses to rename objects: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_update?view=odsp-graph-online - maybe something can be set there? Take a look and see what you think?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.