hari9
November 28, 2020, 9:50am
1
Could someone help me what the commands are to convert all ods,odt,odp (OpenOffice) files to Gdoc files and place the copies within their respective folders.
So for example if I want to start with a sub folder called Admin how do I make sure it only makes Gdoc version copies of ods,odt,odp files?
ncw
(Nick Craig-Wood)
November 28, 2020, 2:31pm
2
So you want to take a directory of ods,odt,odp files and upload them to Google drive as google documents?
Check out the import/export docs from the google drive backend.
I think doing the upload with --drive-import-formats ods,odt,odp
should do the trick.
So set up the remote according to the backend docs - say you called it gdrive
.
Then something like
rclone copy -v /path/to/Admin gdrive:Admin --drive-import-formats ods,odt,odp
This will upload the contents of Admin, but convert the docs into google docs.
1 Like
hari9
November 28, 2020, 2:52pm
3
Hey Nick, thanks for your reply.
The OpenOffice files are all over the Google drive. I want rclone to find them and convert them to their respective gdocs file type.
Is this possible? And what happens to the sharing permissions?
ncw
(Nick Craig-Wood)
November 29, 2020, 10:17am
4
Did the files that are in the drive get uploaded from your computer? If so then the technique above will work.
If you just want to convert docs that are already in your drive then that is a bit harder.
Rclone doesn't mess with sharing permissions. If you share a folder then everything within it will stay shared.
hari9
November 29, 2020, 2:01pm
5
Yes that is the case. Actually the drive has had OpenOffice files added by many different people overtime and now I'd need to convert them all into their respective Gdoc equivalents.
By a bit harder, what did you mean by that?
ncw
(Nick Craig-Wood)
November 29, 2020, 5:15pm
6
OK
This is the best I came up with
rclone move -v --drive-skip-gdocs --include "*.{ods,odt,odp}" drive:GDocs /tmp/GDocs
rclone copy -v --drive-export-formats ods,odt,odp --drive-import-formats ods,odt,odp /tmp/GDocs drive:GDocs
The first downloads all the docs and deletes them from the source - rclone gets really confused if you leave them on the source unfortunately.
The second uploads them as ods,odt,odp files.
If there is individual sharing set up on the files this will mess it up. If the sharing is based on folders then it will be fine.
If you want to try this I suggest you try lots of tests firsts to see if it does what you want.
system
(system)
Closed
January 29, 2021, 1:15pm
7
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.