Coder Social home page Coder Social logo

gdrive's Introduction

IMPORTANT

This repository is not maintained anymore. Gdrive 3 is its successor.

















Prerequisites

None, binaries are statically linked. If you want to compile from source you need the go toolchain. Version 1.5 or higher.

Installation

With Homebrew on Mac

brew install gdrive

Other

Download gdrive from one of the links in the latest release. The first time gdrive is launched (i.e. run gdrive about in your terminal not just gdrive), you will be prompted for a verification code. The code is obtained by following the printed url and authenticating with the google account for the drive you want access to. This will create a token file inside the .gdrive folder in your home directory. Note that anyone with access to this file will also have access to your google drive. If you want to manage multiple drives you can use the global --config flag or set the environment variable GDRIVE_CONFIG_DIR. Example: GDRIVE_CONFIG_DIR="/home/user/.gdrive-secondary" gdrive list You will be prompted for a new verification code if the folder does not exist.

Compile from source

go get github.com/prasmussen/gdrive

The gdrive binary should now be available at $GOPATH/bin/gdrive

Syncing

Gdrive supports basic syncing. It only syncs one way at the time and works more like rsync than e.g. dropbox. Files that are synced to google drive are tagged with an appProperty so that the files on drive can be traversed faster. This means that you can't upload files with gdrive upload into a sync directory as the files would be missing the sync tag, and would be ignored by the sync commands. The current implementation is slow and uses a lot of memory if you are syncing many files. Currently only one file is uploaded at the time, the speed can be improved in the future by uploading several files concurrently. To learn more see usage and the examples below.

Service Account

For server to server communication, where user interaction is not a viable option, is it possible to use a service account, as described in this Google document. If you want to use a service account, instead of being interactively prompted for authentication, you need to use the --service-account <serviceAccountCredentials> global option, where serviceAccountCredentials is a file in JSON format obtained through the Google API Console, and its location is relative to the config dir.

.gdriveignore

Placing a .gdriveignore in the root of your sync directory can be used to skip certain files from being synced. .gdriveignore follows the same rules as .gitignore, except that gdrive only reads the .gdriveignore file in the root of the sync directory, not ones in any subdirectories.

Usage

gdrive [global] list [options]                                 List files
gdrive [global] download [options] <fileId>                    Download file or directory
gdrive [global] download query [options] <query>               Download all files and directories matching query
gdrive [global] upload [options] <path>                        Upload file or directory
gdrive [global] upload - [options] <name>                      Upload file from stdin
gdrive [global] update [options] <fileId> <path>               Update file, this creates a new revision of the file
gdrive [global] info [options] <fileId>                        Show file info
gdrive [global] mkdir [options] <name>                         Create directory
gdrive [global] share [options] <fileId>                       Share file or directory
gdrive [global] share list <fileId>                            List files permissions
gdrive [global] share revoke <fileId> <permissionId>           Revoke permission
gdrive [global] delete [options] <fileId>                      Delete file or directory
gdrive [global] sync list [options]                            List all syncable directories on drive
gdrive [global] sync content [options] <fileId>                List content of syncable directory
gdrive [global] sync download [options] <fileId> <path>        Sync drive directory to local directory
gdrive [global] sync upload [options] <path> <fileId>          Sync local directory to drive
gdrive [global] changes [options]                              List file changes
gdrive [global] revision list [options] <fileId>               List file revisions
gdrive [global] revision download [options] <fileId> <revId>   Download revision
gdrive [global] revision delete <fileId> <revId>               Delete file revision
gdrive [global] import [options] <path>                        Upload and convert file to a google document, see 'about import' for available conversions
gdrive [global] export [options] <fileId>                      Export a google document
gdrive [global] about [options]                                Google drive metadata, quota usage
gdrive [global] about import                                   Show supported import formats
gdrive [global] about export                                   Show supported export formats
gdrive version                                                 Print application version
gdrive help                                                    Print help
gdrive help <command>                                          Print command help
gdrive help <command> <subcommand>                             Print subcommand help

List files

gdrive [global] list [options]

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)

options:
  -m, --max <maxFiles>       Max files to list, default: 30
  -q, --query <query>        Default query: "trashed = false and 'me' in owners". See https://developers.google.com/drive/search-parameters
  --order <sortOrder>        Sort order. See https://godoc.org/google.golang.org/api/drive/v3#FilesListCall.OrderBy
  --name-width <nameWidth>   Width of name column, default: 40, minimum: 9, use 0 for full width
  --absolute                 Show absolute path to file (will only show path from first parent)
  --no-header                Dont print the header
  --bytes                    Size in bytes

List file in subdirectory

./gdrive list --query " 'IdOfTheParentFolder' in parents"

Download file or directory

gdrive [global] download [options] <fileId>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  -f, --force           Overwrite existing file
  -r, --recursive       Download directory recursively, documents will be skipped
  --path <path>         Download path
  --delete              Delete remote file when download is successful
  --no-progress         Hide progress
  --stdout              Write file content to stdout
  --timeout <timeout>   Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300

Download all files and directories matching query

gdrive [global] download query [options] <query>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  -f, --force       Overwrite existing file
  -r, --recursive   Download directories recursively, documents will be skipped
  --path <path>     Download path
  --no-progress     Hide progress

Upload file or directory

gdrive [global] upload [options] <path>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  -r, --recursive               Upload directory recursively
  -p, --parent <parent>         Parent id, used to upload file to a specific directory, can be specified multiple times to give many parents
  --name <name>                 Filename
  --description <description>   File description
  --no-progress                 Hide progress
  --mime <mime>                 Force mime type
  --share                       Share file
  --delete                      Delete local file when upload is successful
  --timeout <timeout>           Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300
  --chunksize <chunksize>       Set chunk size in bytes, default: 8388608

Upload file from stdin

gdrive [global] upload - [options] <name>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  -p, --parent <parent>         Parent id, used to upload file to a specific directory, can be specified multiple times to give many parents
  --chunksize <chunksize>       Set chunk size in bytes, default: 8388608
  --description <description>   File description
  --mime <mime>                 Force mime type
  --share                       Share file
  --timeout <timeout>           Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300
  --no-progress                 Hide progress

Update file, this creates a new revision of the file

gdrive [global] update [options] <fileId> <path>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  -p, --parent <parent>         Parent id, used to upload file to a specific directory, can be specified multiple times to give many parents
  --name <name>                 Filename
  --description <description>   File description
  --no-progress                 Hide progress
  --mime <mime>                 Force mime type
  --timeout <timeout>           Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300
  --chunksize <chunksize>       Set chunk size in bytes, default: 8388608

Show file info

gdrive [global] info [options] <fileId>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  --bytes   Show size in bytes

Create directory

gdrive [global] mkdir [options] <name>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  -p, --parent <parent>         Parent id of created directory, can be specified multiple times to give many parents
  --description <description>   Directory description

Share file or directory

gdrive [global] share [options] <fileId>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  --role <role>     Share role: owner/writer/commenter/reader, default: reader
  --type <type>     Share type: user/group/domain/anyone, default: anyone
  --email <email>   The email address of the user or group to share the file with. Requires 'user' or 'group' as type
  --discoverable    Make file discoverable by search engines
  --revoke          Delete all sharing permissions (owner roles will be skipped)

List files permissions

gdrive [global] share list <fileId>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)

Revoke permission

gdrive [global] share revoke <fileId> <permissionId>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)

Delete file or directory

gdrive [global] delete [options] <fileId>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  -r, --recursive   Delete directory and all it's content

List all syncable directories on drive

gdrive [global] sync list [options]

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  --no-header   Dont print the header

List content of syncable directory

gdrive [global] sync content [options] <fileId>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  --order <sortOrder>        Sort order. See https://godoc.org/google.golang.org/api/drive/v3#FilesListCall.OrderBy
  --path-width <pathWidth>   Width of path column, default: 60, minimum: 9, use 0 for full width
  --no-header                Dont print the header
  --bytes                    Size in bytes

Sync drive directory to local directory

gdrive [global] sync download [options] <fileId> <path>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  --keep-remote         Keep remote file when a conflict is encountered
  --keep-local          Keep local file when a conflict is encountered
  --keep-largest        Keep largest file when a conflict is encountered
  --delete-extraneous   Delete extraneous local files
  --dry-run             Show what would have been transferred
  --no-progress         Hide progress
  --timeout <timeout>   Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300

Sync local directory to drive

gdrive [global] sync upload [options] <path> <fileId>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  --keep-remote             Keep remote file when a conflict is encountered
  --keep-local              Keep local file when a conflict is encountered
  --keep-largest            Keep largest file when a conflict is encountered
  --delete-extraneous       Delete extraneous remote files
  --dry-run                 Show what would have been transferred
  --no-progress             Hide progress
  --timeout <timeout>       Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300
  --chunksize <chunksize>   Set chunk size in bytes, default: 8388608

List file changes

gdrive [global] changes [options]

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  -m, --max <maxChanges>     Max changes to list, default: 100
  --since <pageToken>        Page token to start listing changes from
  --now                      Get latest page token
  --name-width <nameWidth>   Width of name column, default: 40, minimum: 9, use 0 for full width
  --no-header                Dont print the header

List file revisions

gdrive [global] revision list [options] <fileId>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  --name-width <nameWidth>   Width of name column, default: 40, minimum: 9, use 0 for full width
  --no-header                Dont print the header
  --bytes                    Size in bytes

Download revision

gdrive [global] revision download [options] <fileId> <revId>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  -f, --force           Overwrite existing file
  --no-progress         Hide progress
  --stdout              Write file content to stdout
  --path <path>         Download path
  --timeout <timeout>   Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300

Delete file revision

gdrive [global] revision delete <fileId> <revId>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)

Upload and convert file to a google document, see 'about import' for available conversions

gdrive [global] import [options] <path>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  -p, --parent <parent>   Parent id, used to upload file to a specific directory, can be specified multiple times to give many parents
  --no-progress           Hide progress

Export a google document

gdrive [global] export [options] <fileId>

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  -f, --force     Overwrite existing file
  --mime <mime>   Mime type of exported file
  --print-mimes   Print available mime types for given file

Google drive metadata, quota usage

gdrive [global] about [options]

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)
  
options:
  --bytes   Show size in bytes

Show supported import formats

gdrive [global] about import

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)

Show supported export formats

gdrive [global] about export

global:
  -c, --config <configDir>         Application path, default: /Users/<user>/.gdrive
  --refresh-token <refreshToken>   Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>     Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <accountFile>  Oauth service account filename, used for server to server communication without user interaction (file is relative to config dir)

Examples

List files

$ gdrive list
Id                             Name                    Type   Size     Created
0B3X9GlR6EmbnZ3gyeGw4d3ozbUk   drive-windows-x64.exe   bin    6.6 MB   2015-07-18 16:43:58
0B3X9GlR6EmbnTXlSc1FqV1dvSTQ   drive-windows-386.exe   bin    5.2 MB   2015-07-18 16:43:53
0B3X9GlR6EmbnVjIzMDRqck1aekE   drive-osx-x64           bin    6.5 MB   2015-07-18 16:43:50
0B3X9GlR6EmbnbEpXdlhza25zT1U   drive-osx-386           bin    5.2 MB   2015-07-18 16:43:41
0B3X9GlR6Embnb095MGxEYmJhY2c   drive-linux-x64         bin    6.5 MB   2015-07-18 16:43:38

List largest files

$ gdrive list --query "name contains 'gdrive'" --order "quotaBytesUsed desc" -m 3
Id                             Name                     Type   Size     Created
0B3X9GlR6EmbnZXpDRG1xblM2LTg   gdrive-linux-mips64      bin    8.5 MB   2016-02-22 21:07:04
0B3X9GlR6EmbnNW5CTV8xdFkxTjg   gdrive-linux-mips64le    bin    8.5 MB   2016-02-22 21:07:07
0B3X9GlR6EmbnZ1NGS25FdEVlWEk   gdrive-osx-x64           bin    8.3 MB   2016-02-21 20:22:13

Upload file

$ gdrive upload gdrive-osx-x64
Uploading gdrive-osx-x64
Uploaded 0B3X9GlR6EmbnZ1NGS25FdEVlWEk at 3.8 MB/s, total 8.3 MB

Make directory

$ gdrive mkdir gdrive-bin
Directory 0B3X9GlR6EmbnY1RLVTk5VUtOVkk created

Upload file to directory

$ gdrive upload --parent 0B3X9GlR6EmbnY1RLVTk5VUtOVkk gdrive-osx-x64
Uploading gdrive-osx-x64
Uploaded 0B3X9GlR6EmbnNTk0SkV0bm5Hd0E at 2.5 MB/s, total 8.3 MB

Download file

$ gdrive download 0B3X9GlR6EmbnZ1NGS25FdEVlWEk
Downloading gdrive-osx-x64 -> gdrive-osx-x64
Downloaded 0B3X9GlR6EmbnZ1NGS25FdEVlWEk at 8.3 MB/s, total 8.3 MB

Share a file

$ gdrive share 0B3X9GlR6EmbnNTk0SkV0bm5Hd0E
Granted reader permission to anyone

Pipe content directly to google drive

$ echo "Hello World" | gdrive upload - hello.txt
Uploading hello.txt
Uploaded 0B3X9GlR6EmbnaXVrOUpIcWlUS0E at 8.0 B/s, total 12.0 B

Print file to stdout

$ gdrive download --stdout 0B3X9GlR6EmbnaXVrOUpIcWlUS0E
Hello World

Get file info

$ gdrive info 0B3X9GlR6EmbnNTk0SkV0bm5Hd0E
Id: 0B3X9GlR6EmbnNTk0SkV0bm5Hd0E
Name: gdrive-osx-x64
Path: gdrive-bin/gdrive-osx-x64
Mime: application/octet-stream
Size: 8.3 MB
Created: 2016-02-21 20:47:04
Modified: 2016-02-21 20:47:04
Md5sum: b607f29231a3b2d16098c4212516470f
Shared: True
Parents: 0B3X9GlR6EmbnY1RLVTk5VUtOVkk
ViewUrl: https://drive.google.com/file/d/0B3X9GlR6EmbnNTk0SkV0bm5Hd0E/view?usp=drivesdk
DownloadUrl: https://docs.google.com/uc?id=0B3X9GlR6EmbnNTk0SkV0bm5Hd0E&export=download

Update file (create new revision)

$ gdrive update 0B3X9GlR6EmbnNTk0SkV0bm5Hd0E gdrive-osx-x64
Uploading gdrive-osx-x64
Updated 0B3X9GlR6EmbnNTk0SkV0bm5Hd0E at 2.0 MB/s, total 8.3 MB

List file revisions

$ gdrive revision list 0B3X9GlR6EmbnNTk0SkV0bm5Hd0E
Id                                                    Name             Size     Modified              KeepForever
0B3X9GlR6EmbnOFlHSTZQNWJWMGN2ckZucC9VaEUwczV1cUNrPQ   gdrive-osx-x64   8.3 MB   2016-02-21 20:47:04   False
0B3X9GlR6EmbndVEwMlZCUldGWUlPb2lTS25rOFo1L2t6c2ZVPQ   gdrive-osx-x64   8.3 MB   2016-02-21 21:12:09   False

Download revision

$ gdrive revision download 0B3X9GlR6EmbnNTk0SkV0bm5Hd0E 0B3X9GlR6EmbnOFlHSTZQNWJWMGN2ckZucC9VaEUwczV1cUNrPQ
Downloading gdrive-osx-x64 -> gdrive-osx-x64
Download complete, rate: 8.3 MB/s, total size: 8.3 MB

Export google doc as docx

$ gdrive export --mime application/vnd.openxmlformats-officedocument.wordprocessingml.document 1Kt5A8X7X2RQrEi5t6Y9W1LayRc4hyrFiG63y2dIJEvk
Exported 'foo.docx' with mime type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'

Import csv as google spreadsheet

$ gdrive import foo.csv
Imported 1mTl3DjIvap4tpTX_oMkDcbDT8ShtiGJRlozTfkXpeko with mime type: 'application/vnd.google-apps.spreadsheet'

Syncing directory to drive

# Create directory on drive
$ gdrive mkdir drive-bin
Directory 0B3X9GlR6EmbnOEd6cEh6bU9XZWM created

# Sync to drive
$ gdrive sync upload _release/bin 0B3X9GlR6EmbnOEd6cEh6bU9XZWM
Starting sync...
Collecting local and remote file information...
Found 32 local files and 0 remote files

6 remote directories are missing
[0001/0006] Creating directory drive-bin/bsd
[0002/0006] Creating directory drive-bin/linux
[0003/0006] Creating directory drive-bin/osx
[0004/0006] Creating directory drive-bin/plan9
[0005/0006] Creating directory drive-bin/solaris
[0006/0006] Creating directory drive-bin/windows

26 remote files are missing
[0001/0026] Uploading bsd/gdrive-dragonfly-x64 -> drive-bin/bsd/gdrive-dragonfly-x64
[0002/0026] Uploading bsd/gdrive-freebsd-386 -> drive-bin/bsd/gdrive-freebsd-386
[0003/0026] Uploading bsd/gdrive-freebsd-arm -> drive-bin/bsd/gdrive-freebsd-arm
[0004/0026] Uploading bsd/gdrive-freebsd-x64 -> drive-bin/bsd/gdrive-freebsd-x64
[0005/0026] Uploading bsd/gdrive-netbsd-386 -> drive-bin/bsd/gdrive-netbsd-386
[0006/0026] Uploading bsd/gdrive-netbsd-arm -> drive-bin/bsd/gdrive-netbsd-arm
[0007/0026] Uploading bsd/gdrive-netbsd-x64 -> drive-bin/bsd/gdrive-netbsd-x64
[0008/0026] Uploading bsd/gdrive-openbsd-386 -> drive-bin/bsd/gdrive-openbsd-386
[0009/0026] Uploading bsd/gdrive-openbsd-arm -> drive-bin/bsd/gdrive-openbsd-arm
[0010/0026] Uploading bsd/gdrive-openbsd-x64 -> drive-bin/bsd/gdrive-openbsd-x64
[0011/0026] Uploading linux/gdrive-linux-386 -> drive-bin/linux/gdrive-linux-386
[0012/0026] Uploading linux/gdrive-linux-arm -> drive-bin/linux/gdrive-linux-arm
[0013/0026] Uploading linux/gdrive-linux-arm64 -> drive-bin/linux/gdrive-linux-arm64
[0014/0026] Uploading linux/gdrive-linux-mips64 -> drive-bin/linux/gdrive-linux-mips64
[0015/0026] Uploading linux/gdrive-linux-mips64le -> drive-bin/linux/gdrive-linux-mips64le
[0016/0026] Uploading linux/gdrive-linux-ppc64 -> drive-bin/linux/gdrive-linux-ppc64
[0017/0026] Uploading linux/gdrive-linux-ppc64le -> drive-bin/linux/gdrive-linux-ppc64le
[0018/0026] Uploading linux/gdrive-linux-x64 -> drive-bin/linux/gdrive-linux-x64
[0019/0026] Uploading osx/gdrive-osx-386 -> drive-bin/osx/gdrive-osx-386
[0020/0026] Uploading osx/gdrive-osx-arm -> drive-bin/osx/gdrive-osx-arm
[0021/0026] Uploading osx/gdrive-osx-x64 -> drive-bin/osx/gdrive-osx-x64
[0022/0026] Uploading plan9/gdrive-plan9-386 -> drive-bin/plan9/gdrive-plan9-386
[0023/0026] Uploading plan9/gdrive-plan9-x64 -> drive-bin/plan9/gdrive-plan9-x64
[0024/0026] Uploading solaris/gdrive-solaris-x64 -> drive-bin/solaris/gdrive-solaris-x64
[0025/0026] Uploading windows/gdrive-windows-386.exe -> drive-bin/windows/gdrive-windows-386.exe
[0026/0026] Uploading windows/gdrive-windows-x64.exe -> drive-bin/windows/gdrive-windows-x64.exe
Sync finished in 1m18.891946279s

# Add new local file
$ echo "google drive binaries" > _release/bin/readme.txt

# Sync again
$ gdrive sync upload _release/bin 0B3X9GlR6EmbnOEd6cEh6bU9XZWM
Starting sync...
Collecting local and remote file information...
Found 33 local files and 32 remote files

1 remote files are missing
[0001/0001] Uploading readme.txt -> drive-bin/readme.txt
Sync finished in 2.201339535s

# Modify local file
$ echo "for all platforms" >> _release/bin/readme.txt

# Sync again
$ gdrive sync upload _release/bin 0B3X9GlR6EmbnOEd6cEh6bU9XZWM
Starting sync...
Collecting local and remote file information...
Found 33 local files and 33 remote files

1 local files has changed
[0001/0001] Updating readme.txt -> drive-bin/readme.txt
Sync finished in 1.890244258s

List content of sync directory

$ gdrive sync content 0B3X9GlR6EmbnOEd6cEh6bU9XZWM
Id                             Path                             Type   Size     Modified
0B3X9GlR6EmbnMldxMFV1UGVMTlE   bsd                              dir             2016-02-21 22:54:00
0B3X9GlR6EmbnM05sQ3hVUnJnOXc   bsd/gdrive-dragonfly-x64         bin    7.8 MB   2016-02-21 22:54:14
0B3X9GlR6EmbnVy1KXzA4dlU5RVE   bsd/gdrive-freebsd-386           bin    6.1 MB   2016-02-21 22:54:18
0B3X9GlR6Embnb29QQkFtSlRiZnc   bsd/gdrive-freebsd-arm           bin    6.1 MB   2016-02-21 22:54:20
0B3X9GlR6EmbnMkFQYVpSaHhHTXM   bsd/gdrive-freebsd-x64           bin    7.8 MB   2016-02-21 22:54:23
0B3X9GlR6EmbnVmJRMl9hUDloVU0   bsd/gdrive-netbsd-386            bin    6.1 MB   2016-02-21 22:54:25
0B3X9GlR6EmbnLVlTZWpxOEF4Q2s   bsd/gdrive-netbsd-arm            bin    6.1 MB   2016-02-21 22:54:28
0B3X9GlR6EmbnOENUZmh3anJmNG8   bsd/gdrive-netbsd-x64            bin    7.8 MB   2016-02-21 22:54:30
0B3X9GlR6EmbnWTRoQ2ZVQXRfQlU   bsd/gdrive-openbsd-386           bin    6.1 MB   2016-02-21 22:54:32
0B3X9GlR6EmbncEtlN3ZuQ0VUWms   bsd/gdrive-openbsd-arm           bin    6.1 MB   2016-02-21 22:54:35
0B3X9GlR6EmbnMlFLY1ptNEFyZWc   bsd/gdrive-openbsd-x64           bin    7.8 MB   2016-02-21 22:54:38
0B3X9GlR6EmbncGtSajQyNzloVEE   linux                            dir             2016-02-21 22:54:01
0B3X9GlR6EmbnMWVudkJmb1NZdmM   linux/gdrive-linux-386           bin    6.1 MB   2016-02-21 22:54:40
0B3X9GlR6Embnbnpla1R2VHV5T2M   linux/gdrive-linux-arm           bin    6.1 MB   2016-02-21 22:54:42
0B3X9GlR6EmbnM0s2cU1YWkNJSjA   linux/gdrive-linux-arm64         bin    7.7 MB   2016-02-21 22:54:45
0B3X9GlR6EmbnNU9NNi1TdDc4S2c   linux/gdrive-linux-mips64        bin    8.5 MB   2016-02-21 22:54:47
0B3X9GlR6EmbnSmdQNjRKZ2dWV1U   linux/gdrive-linux-mips64le      bin    8.5 MB   2016-02-21 22:54:50
0B3X9GlR6EmbnS0g0OVgxMHY5Z3c   linux/gdrive-linux-ppc64         bin    7.8 MB   2016-02-21 22:54:52
0B3X9GlR6EmbneVp6ZXRpR3FhWlU   linux/gdrive-linux-ppc64le       bin    7.8 MB   2016-02-21 22:54:54
0B3X9GlR6EmbnczdJT195dFVxdU0   linux/gdrive-linux-x64           bin    7.8 MB   2016-02-21 22:54:57
0B3X9GlR6EmbnTXZXeDRnSDdVS1E   osx                              dir             2016-02-21 22:54:02
0B3X9GlR6EmbnWnRheXJNR0pUMU0   osx/gdrive-osx-386               bin    6.6 MB   2016-02-21 22:54:59
0B3X9GlR6EmbnRzNqMWFXdDR1Rms   osx/gdrive-osx-arm               bin    6.6 MB   2016-02-21 22:55:01
0B3X9GlR6EmbnaDlVWTZDd0JIeEU   osx/gdrive-osx-x64               bin    8.3 MB   2016-02-21 22:55:04
0B3X9GlR6EmbnWW84UFBvbHlURXM   plan9                            dir             2016-02-21 22:54:02
0B3X9GlR6EmbnTmc0a2RNdDZDRUU   plan9/gdrive-plan9-386           bin    5.8 MB   2016-02-21 22:55:07
0B3X9GlR6EmbnT1pYZ2p4Sk9FVFk   plan9/gdrive-plan9-x64           bin    7.4 MB   2016-02-21 22:55:10
0B3X9GlR6EmbnbnZnXzlYVHoxdk0   readme.txt                       bin    40.0 B   2016-02-21 22:59:56
0B3X9GlR6EmbnSWF1QUlta3RnaGc   solaris                          dir             2016-02-21 22:54:03
0B3X9GlR6EmbnaWFOV0YxSGs5Znc   solaris/gdrive-solaris-x64       bin    7.7 MB   2016-02-21 22:55:13
0B3X9GlR6EmbnNE5ySkEzbWQ4Qms   windows                          dir             2016-02-21 22:54:03
0B3X9GlR6EmbnX1RIT2w1TWZYWFU   windows/gdrive-windows-386.exe   bin    6.1 MB   2016-02-21 22:55:15
0B3X9GlR6EmbndmVMU05POGRPS3c   windows/gdrive-windows-x64.exe   bin    7.8 MB   2016-02-21 22:55:18

gdrive's People

Contributors

alexanderkjeldaas avatar amigodeveloper avatar anmol-singh-jaggi avatar app-git-hub avatar cjangrist avatar crosbymichael avatar cypherpunksamurai avatar dirkyjerky avatar erich-roncarolo avatar fab-io avatar feschroe avatar gbinside avatar jblazquez avatar joshschriever avatar keramidasceid avatar marksteve avatar mbenlioglu avatar mberk avatar nova77 avatar paulz avatar prasmussen avatar saaros avatar singhsays avatar treeder avatar vandenoever avatar x1011 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gdrive's Issues

Long uploads fail when using stdin

Basically, I'm facing the same issue as in #20. As I can clearly see within the last commit, the bugfix doesn't apply to stdin and only helps when directly specifying large files. As I need both a progress bar and some ratelimiting, I've created a bashscript which recursively uploads whole directories including all files. Also, I've implemented MD5 checksumming, so that those files won't get reuploaded.

The way I'm calling this application is like that: cat largefile | pv -pteraT -L <ratelimit> -s <totalfilesize> | ./gdrive upload -s -t <filename> -p <folderid>. After quiet a few hours of uploading, it failed with "Error 401: Invalid credentials" as listed above. Could that fix also get implemented for uploading via stdin?

10GB File Size Limitation?

Is is possible now to support files larger than 10GB?

I see in their Developer SDK site for Drive API v2 that it still says 10GB, but other sync clients such as insync support files larger than 10GB.

https://support.google.com/drive/answer/37603?hl=en
"Other files: Files that you upload but don’t convert to a Google Docs, Sheets, or Slides format can be up to 1TB each."

I would be so very happy if this great program could support files larger than 10GB.

In the mean time, loving it :)

Cannot get a token for the app

I can't make the drive-linux-amd64 version (v1.6.1) pass the Google authentication step

$ wget 'https://drive.google.com/uc?id=0B3X9GlR6EmbnSWFxaExoUEk1NFk'
$ mv uc\?id\=0B3X9GlR6EmbnSWFxaExoUEk1NFk drive
$ chmod 700 drive
$ ./drive 
Go to the following link in your browser:
https://accounts.google.com/o/oauth2/auth?client_id=<***client id here***>&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=state

Enter verification code:
<*** verification code from Google here ***>
An error occurred creating Drive client: OAuthError: updateToken: Unexpected HTTP status 400 Bad Request

$ lsb_release -a
LSB Version:    core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.5 LTS
Release:    12.04
Codename:   precise

Am I doing anything wrong?

remote import

# go build drive.go

drive.go:5:2: cannot find package "github.com/prasmussen/gdrive/cli" in any of:
        /usr/lib/go/src/pkg/github.com/prasmussen/gdrive/cli (from $GOROOT)
        ($GOPATH not set)
drive.go:6:2: cannot find package "github.com/prasmussen/gdrive/gdrive" in any of:
        /usr/lib/go/src/pkg/github.com/prasmussen/gdrive/gdrive (from $GOROOT)
        ($GOPATH not set)
drive.go:7:2: cannot find package "github.com/prasmussen/gdrive/util" in any of:
        /usr/lib/go/src/pkg/github.com/prasmussen/gdrive/util (from $GOROOT)
        ($GOPATH not set)
drive.go:8:2: cannot find package "github.com/voxelbrain/goptions" in any of:
        /usr/lib/go/src/pkg/github.com/voxelbrain/goptions (from $GOROOT)
        ($GOPATH not set)

Could you help?
This is Debian backported go version go1.3.1 linux/amd64

Space used and space left

Hi, could you add a command to return spaced used, free space, total space of the google drive ?

It would be great to add a check space left before uploading a large file,
or specify a min_free_space=500mb
so an upload doesn't fill all the space left ... because emails will bounce back if no more space.

P.S.
It would be usefull to have all filesize return in bytes with
list -b and info -b

Thanks and great work !

upload folder, some files are missing

I just uploaded a folder with
gdrive-cli upload -f name\ folder/ -p 0123456789abcdef

Of the 7 files in folder, 2 are missing.
Is there a way to understand why? A log file, a verbose mode?

thanks

Flag -i should not be needed

When working with files we could not need to provide -i with the id, it should be part of the args.

gdrive info -i aldksjfladskjf
gdrive info aldksjfladskjf

I'm not too familiar with the flags package that you are using. Do you know if the package supports taking args and populating the Options struct?

Add OCR support

Great tool! Thanks for making this.
Can you add the option to enable OCR on a file upload?

gdrive doesn't show Google Docs

drive list -nq "'$fileid' in parents"

where $fileid is the ID of a folder containing .gdoc (Google Docs) files and child folders only shows the child folders.

Listing the contents of one of the child folders shows the PDFs it contains, so it seems like .gdoc files aren't visible using this tool?

Very annoying as Google Drive has begun converting all notes from .gdoc to .docx upon zip download, with no option to turn off conversion as for uploads 😞

Edit: Notes on my solution to the latter problem are here (though still unclear why this tool can't make the process easier)

add new request

Hi,
Please add a new feature to delete all files(empty) in the drive instead of delete file one by one.

Thanks for useful script.

Upload a folder

It would be great to be able to upload an entire folder at once.

Directory upload in Win

Great little helper, I'm just missing a couple of details:

  • Is it possible to upload full folders on a Win environment?
    I have tried all possible commands but I cannot make it work.
    drive-windows-amd64.exe upload -f test
    drive-windows-amd64.exe upload -f /test
    drive-windows-amd64.exe upload -f \test
    ...
    Any ideas?

Also, the ability of uploading new versions of a file would be a great addition, as discussed in many other posts. This would allow us to use the versioning feature in Drive.

Thanks again

trickle doesn't work with gdrive

I'm uploading 20 folders with the new folder option and it works really great!
I would like to use trickle to limit the upload bandwith but i saw it doesn't work with gdrive.

I run a command like this:
trickle -u 10 drive.go upload -p 0f4543fe2fdB8 -f /mnt/usb/

But it always use full upload bandwith.

Could you try and test it?
Thanks.

auth error

summary:  331 GiByte in 15h 42min 35.7sec - average of 6136 KiB/s
An error occurred uploading the document: googleapi: Error 401: Invalid Credentials, authError

kept getting this error when uploading large file
any suggestion?

download by type

is it possible to download by type just as you can in the web UI of google drive ?

How to get file or folder ID by remote path?

How to get file or folder ID in remote path?

for example:
pi@PI:~$drive list --getId /RaspberryPi/Files
0b_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
(↑↑↑Don't work,just example↑↑↑)

google drive allow same filename in a folder,when it occur:
pi@PI:~$drive list --getId /RaspberryPi/Files/123.txt
0b_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2015-02-13 11:22:33
0b_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 2015-02-13 12:34:56
(↑↑↑Don't work,just example↑↑↑)

my english is not grate,please ignore my grammar problem.

"-m 1" not working

Hi prasmussen

I query list normal is success but add -m 1 (to get first item) then is not result

C:\Windows\system32>gdrive list -q "title contains 'full'"
Id Title Size Created
0BxRXe4e5tCA0SlZNNWtnUEtJRUU FULL-(local)-smart_...0150225_030000.sqb 507 MB 2015-02-25 03:02:15
0BxRXe4e5tCA0ZGdpTGNhSkJCWTA FULL-(local)-smart_...0150224_030000.sqb 506 MB 2015-02-24 03:02:16
0BxRXe4e5tCA0dmFZZjlZdlljc2s FULL-(local)-smart_...0150223_030000.sqb 504 MB 2015-02-23 03:02:08
0BxRXe4e5tCA0SXlLcFZPU0huT1k FULL-(local)-smart_...0150222_030000.sqb 503 MB 2015-02-22 03:02:17
0BxRXe4e5tCA0M2VvMWp1WnJSQ0U FULL-(local)-smart_...0150221_030000.sqb 502 MB 2015-02-21 03:02:07
0BxRXe4e5tCA0TG1RNjNvZV9PNE0 FULL-(local)-smart_...0150220_030000.sqb 501 MB 2015-02-20 03:01:59
0BxRXe4e5tCA0M0d5djZtaEZkMFE FULL-(local)-smart_...0150219_030000.sqb 500 MB 2015-02-19 03:03:04
0BxRXe4e5tCA0eW8xU0lwbGRfRkU FULL-(local)-smart_...0150217_030000.sqb 499 MB 2015-02-17 03:01:56

C:\Windows\system32>gdrive list -q "title contains 'full'" -m 1
Id Title Size Created

C:\Windows\system32>

please fix error
Thanks. Your tools are very excellent work backup. I love your gdrive tool.

upload from stdin doesn't name upload file

$ echo "Hello World" | ./drive upload --stdin --title hello.txt
Id: 0B-9_enX9c21xNkRDRkowTGkwNDA
Title: untitled
Size: 12 B
Created: 2015-02-25 23:57:28
Modified: 2015-02-25 23:57:28
Owner: Carlos Garay
Md5sum: e59ff97941044f85df5297e1c302d260
Shared: False
Parents: 0AO9_enX9c21xUk9PVA
MIME Type:
Uploaded 'untitled' at 12 B/s, total 12 B

Using drive-linux-amd64 v1.5.0 on Ubuntu 14.04.1 LTS. Confirmed to also be a bug in Yosemite using drive-osx-amd64 v1.5.0

authentication failure

gdrive can't create Drive client

root@radxa:/home# ./drive
Go to the following link in your browser:
https://accounts.google.com/o/oauth2/auth?client_id=367116221053-7n0vf5akeru7on6o2fjinrecpdoe99eg.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=state

Enter verification code: ---verification code here--
An error occurred creating Drive client: Post https://accounts.google.com/o/oauth2/token: EOF

root@radxa:/home#

long uploads fail

Uploads that take longer than 1 hour (due to file size or limited bandwidth, or both) result in:

googleapi: Error 401: Invalid Credentials, authError

from code.google.com/p/google-api-go-client/drive/v2/drive-gen.go:3481, upon googleapi.CheckResponse(res).

My assumption is that Google is testing the expired-during-transit access_key upon completion of the POST rather than at the beginning.

broken pipe uploading 500mb file

This is the error message I get when trying to upload a 500mb file.

An error occurred uploading the document: Post https://www.googleapis.com/upload/drive/v2/files?alt=json&uploadType=multipart: write tcp 74.125.28.95:443: broken pipe

Multiple Parents

Hi

I just started using your binaries and I find it to be great. Just wanted to know if there is a provision to make multiple parents of an object being uploaded. I read somewhere that google drive gives this feature

cron job configuration

Hello!

Thank you for this project. I have a problem, I am able to use the drive in a shell script, however when I set it as a cron job for the same user, it fails.

I have tried with custom config file and no changes..

Do you know how I might be able to debug it?
Thanks!

Upload a directory, check MD5 of files before

If uploading a directory, it reuploads file that didn't change.

Would be better to check files already on server, compare their MD5 with local files,
upload only files that changed.

Thanks

`gdrive list` seems to return a max of 94 items

The gdrive list command seems to never return more than 94 items (plus a one line header). Examples:

macbookpro:~ griscom$ gdrive list -q "title != 'lksdlkjsdfljkds'" | wc
      95     790   10070
macbookpro:~ griscom$ gdrive list -q "title contains '0'" | wc
      95     790   10070
macbookpro:~ griscom$ gdrive list -q "title contains 'xml'" | wc
      31     191    3100
macbookpro:~ griscom$ gdrive list -q "title contains '1'" | wc
      95     790   10070
macbookpro:~ griscom$ gdrive list | wc
      95     790   10070
macbookpro:~ griscom$ gdrive list -q "title contains 'd'" | wc
      95     790   10070
macbookpro:~ griscom$ gdrive list -q "title contains 'l'" | wc
      95     790   10070
macbookpro:~ griscom$ gdrive list -q "title contains 'lksdflkj8833'" | wc
       1       4      31
macbookpro:~ griscom$ 

Is this a Google Drive limitation, or something inside of gdrive?

armv5 version

Could you provide a version for armv5 ?

When I try "drive-linux-rpi v1.6.1" on my NAS (NSA325v2) I get "Illegal instruction (core dumped)"
Using "drive-linux-arm v1.6.1" I get "runtime: this CPU has no floating point hardware, so it cannot run
this GOARM=6 binary. Recompile using GOARM=5."

NSA325 uses a Marvell Kirkwood . Looking at arch linux, this is a armv5 platform.

Max list at 460

For some reason, running list while querying against a parent ID (listing all files in that directory) even with a -m for max return value only returns 460 file entries... anything lower than 460 works properly, but nothing seems to work past it.

drive -a and drive -c

Hi. I was wondering how to use drive -a to change a google drive account.

drive -c doesn't seem to do anything but it may be because I have the wrong arguments.

Exit code is not set

Hi

When an error occurs, the exit code is still set to 0.

The error message is print but the program does not exit with none zero exit code. It can be read in the code:

fmt.Printf("An error occurred: %v\n", err)

The current behavior makes the following command to always output OK even when it should fail:
(gdrive/gdrive -c gdrive/conf upload -f tmp/* && echo OK) || echo FAIL

An error occurred uploading the document: googleapi: Error 403: The user has exceeded their Drive storage quota
OK

Download links

The download links for linux version do not contain extensions. In what format are they exactly in?

Upload into a directory?

Hey @prasmussen, very well done. I see great potential in this tool, but I couldn't find any documentation and my tests failed:
how would one upload a file into an existing directory?

My plan is to automate a build script and share the binarys in a public folder on my gdrive

Thanks and keep up the good work!

Error uploading big files

Uploading a big file (>20GB) to my Drive lead me to this error:

An error occurred uploading the document: Post https://www.googleapis.com/upload/drive/v2/files?alt=json&convert=false&uploadType=resumable&upload_id=CUT: dial tcp: lookup www.googleapis.com on 8.8.8.8:53: dial udp 8.8.8.8:53: too many open files

I have enough free space to upload the file and I use version 1.5.1 on ubuntu 14.04 amd64.

P.S. Am I the only one having lower uploading speed with latest version? ~1-2MB/s on a 100Mbit network.

Upload speed issue

I've noticed several people here are having speed issue.

For me, I am using a VPS, which comes with at least 200MiB/s upload speed, and great peering with Google.

But my speed is kinds of limited to 1~1.5MiB/s.

Any idea what caused such problem?

@erpalma
@bxshi

File revision

Google drive provides file revision for up to 30 days,
could gdrive access those information and allow reverting to an older version ?

Also, if uploading a file with same name in the same directory, overwrite the old one instead of creating a new file.

Thanks

Directory upload is not recursive

I suppose this is a deliberate choice, but the fact that uploading a directory only uploads the files in it (and not the subdirectories) is rather inconvenient - especially since it's not made clear.
Ideally, there should be a recursive mode but, failing that, I think that the behavior should be explicit.

Folder support

When I use upload verb, it currently interprets slashes as it is rather than directory notation, so it makes a title with slashes in the root of the drive. I think it would be better if it supports uploading to folders.

Thanks for your great software!

File Type Recognition

Thank you for making this tool!
I've uploaded the apk file.

"C:\gdrive\drive-windows-386.exe" upload --file "C:\test.apk"

It seemed to be able to upload successfully. But, the file seems to be recognized as a zip file.
When I upload it manually, apk has been recognized correctly. I think it's a problem of this tool.
Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.