Gdrive: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 6: Line 6:


=Authentication=
=Authentication=
Upon the first usage, gdrive gets an authentication link from Google Drive:
<pre>
./gdrive upload --parent ... some-file.txt
Authentication needed
Go to the following url in your browser:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=...&redirect_uri=...&response_type=code&scope=...&state=state
Enter verification code:
</pre>
The link must be used from a browser to provide authentication and enable gdrive to manage files:
[[Image:gdrive.png]]
Upon approval, Google Drive provide an authentication code, which should be passed to gdrive.
The authentication code is cached locally. <font color=red>For how long and where?</font>


=Usage=
=Usage=
Line 14: Line 33:
gdrive upload --parent 0B3X9GlR6EmbnY1RLVTk5VUtOVkk gdrive-osx-x64
gdrive upload --parent 0B3X9GlR6EmbnY1RLVTk5VUtOVkk gdrive-osx-x64
</pre>
</pre>
This is how you [[Google_Drive#Obtain_File.2FFolder_ID|find the file/folder ID]].


==Download File==
==Download File==
Line 20: Line 41:
$ gdrive download 0B3X9GlR6EmbnZ1NGS25FdEVlWEk
$ gdrive download 0B3X9GlR6EmbnZ1NGS25FdEVlWEk
</pre>
</pre>
This is how you [[Google_Drive#Obtain_File.2FFolder_ID|find the file/folder ID]].

Latest revision as of 16:48, 2 November 2016

External

Overview

Authentication

Upon the first usage, gdrive gets an authentication link from Google Drive:

./gdrive upload --parent ... some-file.txt
Authentication needed
Go to the following url in your browser:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=...&redirect_uri=...&response_type=code&scope=...&state=state

Enter verification code: 

The link must be used from a browser to provide authentication and enable gdrive to manage files:

Gdrive.png

Upon approval, Google Drive provide an authentication code, which should be passed to gdrive.

The authentication code is cached locally. For how long and where?

Usage

Upload File

gdrive upload --parent 0B3X9GlR6EmbnY1RLVTk5VUtOVkk gdrive-osx-x64

This is how you find the file/folder ID.

Download File

$ gdrive download 0B3X9GlR6EmbnZ1NGS25FdEVlWEk

This is how you find the file/folder ID.