google-drive-ocamlfuse
google-drive-ocamlfuse copied to clipboard
Duration till which headless authorization remains valid
I am trying to use google-drive-ocaml through a GCP VM instance. I completed the headless authorization once and was successful in mounting my drive. However, when I stop the VM instance and restart again the authorization doesn't seem to work and asks me to authorize again.
My questions
- How long does the authorization work?
- GCP charges based on the uptime of a machine hence I'm bound to stop the VM after each use to prevent unnecessary deductions. Is there a workaround to make the authorization permanent?
The authorization is valid until you manually revoke it. The refresh token is saved in ~/.gdfuse/default/state
. If you keep that file, it should not ask you for authorization again.
@astrada, whenever I restart the VM the refresh token field in the file ~/.gdfuse/default/state
vanishes. What possibly could the reason be?
Also, @astrada I try to untar files which are around 4G in size using google-drive-ocamlfuse but the speed at which the untar happens is extremely slow (2.6kps). I saw the VM resources being used and it still has plenty of RAM and CPU left then too it is slow. Why could this be happening? Is it something to do with syncing and stuff that google-drive-ocamlfuse does in the background?
What possibly could the reason be?
Are you sure that the files in your home are persisted between restarts?
Why could this be happening?
The tar file needs to be downloaded in cache before untarring. If you don't need to modify it, you can enable streaming to skip the cache reading large files.
@astrada Nope, I don't want to modify the tar files just untar them on drive. In order to run the linux untar command on those tar files available on drive I first mount it onto a gcp VM instance and then run the tar -xvf
on them (which I hope will be reflected on drive also). How can I use google-drive-ocaml to perform this task most effectively? I have 12 such tar files each of size around 4GB
Set stream_large_files=true
in the config file.
@astrada, I tried headless authorization again today. I could mount and use ocamlfuse properly but when I tried to see the refresh_token, the field is empty. I feel my headless authorization is not saving refresh token into the file ~/.gdfuse/default/state
Inside my state file
last_access_token=
refresh_token=
How to resolve this?
Solved the issue by manually copy pasting refresh_token, last_access_token in ~/.gdfuse/default/state
and client_id, client_secret in ~/.gdfuse/default/config
@astrada, after setting stream_large_files=true
the extraction speed improved to 3.5kbps. Can I improve it further by any means?