Repository navigation
Description
Snippet from cjnaz/rclonesync-V2#1
The problem comes up if we attempt to upload a modified exported document, with the same name,
back to Google Drive: "Failed to copy: can't update a google document". Similarly, deleting the
local copy and then rclone syncing local to Drive: results in "Couldn't delete: can't delete a google
document".
Proposed behavior:
A new --export-google-docs switch will export (copy to Local) every found Google document as
_export.. The final rclone sync will put a copy of the exported document on Google
Drive as well. The date-stamp on the file will match the original Google document.
Later, with --export-google-docs, If the native Google document timestamp is newer, and the
existing exported file is unchanged (relative to the prior sync), then the document will
be exported again, replacing the current _export file.
If the exported file is changed (newer) then it will be synchronized as usual/normal, but the
native Google document cannot be updated. Effectively, the file version and the native version
are out of sync.
If the exported file had previously been changed, and now the native Google document is changed,
then --export-google-docs will blast/replace the file version. User beware. There is no reliable
way to detect that the file version and the native Google document version have both been
modified. The user is advised to rename the modified file version if he/she plans to subsequently
edit the native Google document via the web interface.
If --export-google-docs switch is not set then all Google document files (as indicated by
file size -1) will be ignored. Previously exported documents (which are now regular files)
will be synchronized as usual.
Other comments
As @ncw noted at #5164 (comment)
we should probably consider other things with size < 0 (eg Google Photos) which will have that too.
As @cjnaz noted in his commit review, the log message Ignoring incorrect line: "- -1 - - ... GoogleDoc.docx is rather vague and should be improved. The commented dump from bisync.md was:
2021/05/11 08:23:15 INFO : Synching Path1 "/path/to/local/tree/base/" with Path2 "GDrive:"
2021/05/11 08:23:15 INFO : ...path2.lst-new: Ignoring incorrect line: "- -1 - - 2018-07-29T08:49:30.136000000+0000 GoogleDoc.docx"
2021/05/11 08:23:15 INFO : Bisync successful
References
- Handling Google Documents (V2) cjnaz/rclonesync-V2#1
- comment by @cjnaz w.r.t google docs in https://github.com/rclone/rclone/files/7314114/bisync.md
- WIP: drive: upload documents and document links #2479
- drive: handle Google Docs in Fs.list #2411
- drive: use new exportLinks for exporting documents #2893
- (Bugs) make duplicate google docs with blank content #3986
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Metadata
Metadata
Type
Projects
- StatusShow more project fieldsDone
Activity
ivandeex commentedon Mar 29, 2022
Related problem report:
https://forum.rclone.org/t/bisync-of-googledocs-on-googledrive/29961/2
ivandeex commentedon Apr 15, 2022
Probably related issue reported on forum
https://forum.rclone.org/t/is-bisync-ready-for-prime-time/30109/9
[-]bisync: improve handling of Google Docs[/-][+]bisync: fix handling of Google Docs[/+]jokob-sk commentedon Apr 27, 2022
Probably related issue in the forums:
nielash commentedon Aug 20, 2023
This appears to no longer be true. It looks like the quoted comment is from 2018, and a few months later Rclone greatly improved its handling of Google Docs, but the Bisync code was never updated to reflect this new reality (even despite being translated in 2021, after these changes).
So, it looks to me like all we really need to do here is remove the code that was added to detect and skip Google Docs, and just let Rclone handle them the same way it would for
sync. (A quick test on my end seems to confirm this, but I want to test further and just make sure I'm not missing something.)That said, I will still personally be keeping
--drive-skip-gdocson all my Bisync runs, as I'm not keen to have my Google Docs overwritten by local.docxversions, nor do I want my actual.docxfiles converted to Google Docs. But it should be supportable for people who do 😃Also, when we fix #5683 and #5684 we'll have to handle this case with special care... Google Docs always have a size of
-1and no checksum, so it will always look like a mismatch with the opposite path, if we're only comparing the listing strings. But until then it shouldn't matter, as comparing the modtime should still work.Rixtho commentedon Oct 31, 2023
Just wanted to ask whether there is any active development on this issue?
Also a bit unrelated… If I understood correctly it is already possible to convert Google Doc files to links. But this still creates a syncing issue as rclone then also copies those links to Google Drive. I would prefer if links to Google Docs would not be also synced to Google Drive since these links are unnecessary duplicates when accessing my drive from Windows or my phone.
Also I think it is possible via Chrome's API to download all Google Doc files into web storage. If you edit files there Chrome should automatically take care of synchronization. So only thing rclone would have to do is convert Google Docs into links that open that specific file from web storage. I think this would be a more elegant solution than converting Google Docs into completely different formats.
nielash commentedon Oct 31, 2023
@Rixtho I actually have a fix ready to go, but have been sitting on it until I have a chance to test it more thoroughly (which I haven't done yet because I've been focusing on a few higher-priority tickets.) Would you be interested in helping to beta-test it and give feedback?
I think you're referring to the
--drive-export-formats=urloption, right? If so, I think for the most part this should already work how you want it to, with some important caveats I'll explain below. For example, if you currently run the following:the
.urlfiles will be created locally during the first command, and not duplicated in drive during the second command (because rclone finds a gdoc with the same name and understands they are the same file). Where you do have to be careful is if you manually create/rename a.urlfile on the local side, because if you sync with local as the source and then rclone doesn't find a matching gdoc on the drive side, it won't know what you want it to do -- so in that scenario it would copy the literal.urlfile to drive.As far as bisync is concerned, my proposed fix essentially just lifts the current bisync-specific restrictions on google docs and allows rclone to handle them the same way it would in
sync. This means that--drive-export-formats=urlshould also work as expected (just be sure to only create/edit/rename your google docs on the google drive side, because of the above.)That is an interesting idea. Since it affects the
drivebackend as a whole (not just bisync), I would suggest opening a new issue to request and discuss it further.Rixtho commentedon Nov 1, 2023
@nielash I've never worked on this project before and I'm not an expert on Rclone, so I'm not sure if I'm the best choice. What do you mean by beta testing? Just manually running different scenarios and checking if everything works as expected? If you could provide a rough guide, I might be able to help with the testing.
As for my other idea, it seems that the URL is already enough to access a file if it was made available offline via Google Drive in Chrome. So the only possible improvement would be if Rclone could take care of making all my Google Workspace files available offline, instead of me having to manually go through all my folders and click "make available offline". A quick Google search didn't turn up any results about whether this is possible via the Google Drive API, but I could open an investigation issue on this.
nielash commentedon Nov 9, 2023
Yes, that is basically what I mean! Are you comfortable with installing from source?
11 remaining items
bisync: support files with unknown length, including Google Docs - fixes
bisync: support files with unknown length, including Google Docs - fixes
bisync: support files with unknown length, including Google Docs - fixes
bisync: support files with unknown length, including Google Docs - fixes
bisync: support files with unknown length, including Google Docs - fixes
hideki2k02 commentedon Dec 26, 2023
Many thanks for that! Been scratching my head for days trying to figure out why my bisync script was not working haha
bisync: support files with unknown length, including Google Docs - fixes
Merge branch 'master' into ia-wt-1168
bisync: support files with unknown length, including Google Docs - fixes