1# drive 2 3[![Build Status](https://travis-ci.org/odeke-em/drive.png?branch=master)](https://travis-ci.org/odeke-em/drive) 4 5`drive` is a tiny program to pull or push [Google Drive](https://drive.google.com) files. 6 7`drive` was originally developed by [Burcu Dogan](https://github.com/rakyll) while working on the Google Drive team. Since she is very busy and no longer able to maintain it, I took over drive on `Thursday, 1st January 2015`. This repository contains the latest version of the code. 8 9## Table of Contents 10 11- [Installing](#installing) 12 - [Requirements](#requirements) 13 - [From sources](#from-sources) 14 - [Godep](#godep) 15 - [Platform Packages](#platform-packages) 16 - [Automation Scripts](#automation-scripts) 17 - [Cross Compilation](#cross-compilation) 18 - [API keys](#api-keys) 19- [Usage](#usage) 20 - [Hyphens: - vs --](#hyphens---vs---) 21 - [Initializing](#initializing) 22 - [De Initializing](#de-initializing) 23 - [Traversal Depth](#traversal-depth) 24 - [Configuring General Settings](#configuring-general-settings) 25 - [Excluding And Including Objects](#excluding-and-including-objects) 26 - [Sample .driveignore with the exclude and include clauses combined](sample-.driveignore-with-the-exclude-and-include-clauses-combined) 27 - [Pulling](#pulling) 28 - [Verifying Checksums](#verifying-checksums) 29 - [Exporting Docs](#exporting-docs) 30 - [Pushing](#pushing) 31 - [Pulling And Pushing Notes](#pulling-and-pushing-notes) 32 - [End to End Encryption](#end-to-end-encryption) 33 - [Publishing](#publishing) 34 - [Unpublishing](#unpublishing) 35 - [Sharing and Emailing](#sharing-and-emailing) 36 - [Unsharing](#unsharing) 37 - [Starring Or Unstarring](#starring-or-unstarring) 38 - [Diffing](#diffing) 39 - [Touching](#touching) 40 - [Trashing And Untrashing](#trashing-and-untrashing) 41 - [Emptying The Trash](#emptying-the-trash) 42 - [Deleting](#deleting) 43 - [Listing](#listing) 44 - [Stating](#stating) 45 - [Printing URL](#printing-url) 46 - [Editing Description](#editing-description) 47 - [Retrieving MD5 Checksums](#retrieving-md5-checksums) 48 - [Retrieving FileId](#retrieving-fileid) 49 - [Retrieving Quota](#retrieving-quota) 50 - [Retrieving Features](#retrieving-features) 51 - [Creating](#creating) 52 - [Opening](#opening) 53 - [Copying](#copying) 54 - [Moving](#moving) 55 - [Renaming](#renaming) 56 - [Command Aliases](#command-aliases) 57 - [Detecting And Fixing Clashes](#detecting-and-fixing-clashes) 58 - [.desktop Files](#desktop-files) 59 - [Fetching And Pruning Missing Index Files](#fetching-and-pruning-missing-index-files) 60 - [Drive Server](#drive-server) 61 - [QR Code Share](#qr-code-share) 62 - [About](#about) 63 - [Help](#help) 64 - [Filing Issues](#filing-issues) 65- [Revoking Account Access](#revoking-account-access) 66- [Uninstalling](#uninstalling) 67- [Applying Patches](#applying-patches) 68- [Why Another Google Drive Client?](#why-another-google-drive-client) 69- [Known Issues](#known-issues) 70- [Reaching Out](#reaching-out) 71- [Disclaimer](#disclaimer) 72- [LICENSE](#license) 73 74## Installing 75 76### Requirements 77 78go 1.9.X or higher is required. See [here](https://golang.org/doc/install) for installation instructions and platform installers. 79 80* Make sure to set your GOPATH in your env, .bashrc or .bash\_profile file. If you have not yet set it, you can do so like this: 81 82```shell 83cat << ! >> ~/.bashrc 84> export GOPATH=\$HOME/gopath 85> export PATH=\$GOPATH:\$GOPATH/bin:\$PATH 86> ! 87source ~/.bashrc # To reload the settings and get the newly set ones # Or open a fresh terminal 88``` 89The above setup will ensure that the drive binary after compilation can be invoked from your current path. 90 91### From sources 92 93To install from the latest source, run: 94 95```shell 96go get -u github.com/odeke-em/drive/cmd/drive 97``` 98 99Otherwise: 100 101* In order to address [issue #138](https://github.com/odeke-em/drive/issues/138), where debug information should be bundled with the binary, you'll need to run: 102 103```shell 104go get github.com/odeke-em/drive/drive-gen && drive-gen 105``` 106 107In case you need a specific binary e.g for Debian folks [issue #271](https://github.com/odeke-em/drive/issues/271) and [issue 277](https://github.com/odeke-em/drive/issues/277) 108 109```shell 110go get -u github.com/odeke-em/drive/drive-google 111``` 112 113That should produce a binary `drive-google` 114 115OR 116 117To bundle debug information with the binary, you can run: 118 119```shell 120go get -u github.com/odeke-em/drive/drive-gen && drive-gen drive-google 121``` 122 123### Godep 124 125+ Using godep 126``` 127cd $GOPATH/src/github.com/odeke-em/drive/drive-gen && godep save 128``` 129 130+ Unravelling/Restoring dependencies 131``` 132cd $GOPATH/src/github.com/odeke-em/drive/drive-gen && godep restore 133``` 134 135Please see file `drive-gen/README.md` for more information. 136 137### Platform Packages 138 139For packages on your favorite platform, please see file [Platform Packages.md](https://github.com/odeke-em/drive/blob/master/platform_packages.md). 140 141Is your platform missing a package? Feel free to prepare / contribute an installation package and then submit a PR to add it in. 142 143#### Automation Scripts 144 145You can install scripts for automating major drive commands and syncing from [drive-google wiki](https://gitlab.com/jean-christophe-manciot/Drive/wikis/Drive-Automation-Scripts:-Startup-Guide-and-Screenshots), also described in [platform_packages.md](https://github.com/odeke-em/drive/blob/master/platform_packages.md). 146Some screenshots are available [here](https://gitlab.com/jean-christophe-manciot/Drive/wikis/Drive-Automation-Scripts:-Startup-Guide-and-Screenshots#drive-menu-screenshots). 147 148### Cross Compilation 149 150See file `Makefile` which currently supports cross compilation. Just run `make` and then inspect the binaries in directory `bin`. 151 152* Supported platforms to cross compile to: 153- ARMv5. 154- ARMv6. 155- ARMv7. 156- ARMv8. 157- Darwin (OS X). 158- Linux. 159 160Also inspect file `bin/md5Sums.txt` after the cross compilation. 161 162### API keys 163 164Optionally set the `GOOGLE_API_CLIENT_ID` and `GOOGLE_API_CLIENT_SECRET` environment variables to use your own API keys. 165 166## Usage 167 168### Hyphens: - vs -- 169 170A single hyphen `-` can be used to specify options. However two hyphens `--` can be used with any options in the provided examples below. 171 172### Initializing 173 174Before you can use `drive`, you'll need to mount your Google Drive directory on your local file system: 175 176#### OAuth2.0 credentials 177```shell 178drive init ~/gdrive 179cd ~/gdrive 180``` 181 182#### Google Service Account credentials 183```shell 184drive init --service-account-file <gsa_json_file_path> ~/gdrive 185cd ~/gdrive 186``` 187 188Where <gsa_json_file_path> must be a [Google Service Account credentials](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount) file in JSON form. 189This feature was implemented as requested by: 190+ https://github.com/odeke-em/drive/issues/879 191 192 193### De Initializing 194 195The opposite of `drive init`, it will remove your credentials locally as well as configuration associated files. 196 197```shell 198drive deinit [-no-prompt] 199``` 200 201For a complete deinitialization, don't forget to revoke account access, [please see revoking account access](#revoking-account-access) 202 203### Traversal Depth 204 205Before talking about the features of drive, it is useful to know about "Traversal Depth". 206 207Throughout this README the usage of the term "Traversal Depth" refers to the number of 208 209nodes/hops/items that it takes to get from one parent to children. In the options that allow it, you'll have a flag option `-depth <n>` where n is an integer 210 211* Traversal terminates on encountering a zero `0` traversal depth. 212 213* A negative depth indicates infinity, so traverse as deep as you can. 214 215* A positive depth helps control the reach. 216 217Given: 218 219 |- A/ 220 |- B/ 221 |- C/ 222 |- C1 223 |- C2 224 |- C10/ 225 |- CTX/ 226 | - Music 227 | - Summary.txt 228 229+ Items on the first level relative to A/ ie `depth 1`, we'll have: 230 231 B, C 232 233+ On the third level relative to C/ ie `depth 3` 234 235 * We'll have: 236 237 Items: Music, Summary.txt 238 239 * The items encountered in `depth 3` traversal relative to C/ are: 240 241 |- C1 242 |- C2 243 |- C10/ 244 |- CTX/ 245 | - Music 246 | - Summary.txt 247 248+ No items are within the reach of `depth -1` relative to B/ since B/ has no children. 249 250+ Items within the reach of `depth -` relative to CTX/ are: 251 252 | - Music 253 | - Summary.txt 254 255### Configuring General Settings 256 257drive supports resource configuration files (.driverc) that you can place both globally (in your home directory) 258and locally(in the mounted drive dir) or in the directory that you are running an operation from, relative to the root. 259The entries for a .driverc file is in the form a key-value pair where the key is any of the arguments that you'd get 260from running 261```shell 262drive <command> -h 263# e.g 264drive push -h 265``` 266 267and the value is the argument that you'd ordinarily supply on the commandline. 268.driverc configurations can be optionally grouped in sections. See https://github.com/odeke-em/drive/issues/778. 269 270For example: 271 272```shell 273cat << ! >> ~/.driverc 274> # My global .driverc file 275> export=doc,pdf 276> depth=100 277> no-prompt=true 278> 279> # For lists 280> [list] 281> depth=2 282> long=true 283> 284> # For pushes 285> [push] 286> verbose=false 287> 288> # For stats 289> [stat] 290> depth=3 291> 292> # For pulls and pushes 293> [pull/push] 294> no-clobber=true 295> ! 296 297cat << ! >> ~/emm.odeke-drive/.driverc 298> # The root main .driverc 299> depth=-1 300> hidden=false 301> no-clobber=true 302> exports-dir=$HOME/exports 303> ! 304 305cat << $ >> ~/emm.odeke-drive/fall2015Classes/.driverc 306> # My global .driverc file 307> exports-dir=$HOME/Desktop/exports 308> export=pdf,csv,txt 309> hidden=true 310> depth=10 311> exclude-ops=delete,update 312> $ 313``` 314 315### Excluding and Including Objects 316 317drive allows you to specify a '.driveignore' file similar to your .gitignore, in the root 318directory of the mounted drive. Blank lines and those prefixed by '#' are considered as comments and skipped. 319 320For example: 321 322```shell 323cat << $ >> .driveignore 324> # My drive ignore file 325> \.gd$ 326> \.so$ 327> \.swp$ 328> $ 329``` 330 331Note: 332 * Pattern matching and suffixes are done by regular expression matching so make sure to use a valid regular expression suffix. 333 334 * Go doesn't have a negative lookahead mechanism ie `exclude all but` which would 335 normally be achieved in other languages or regex engines by "?!". See https://groups.google.com/forum/#!topic/golang-nuts/7qgSDWPIh_E. 336 This was reported and requested in [issue #535](https://github.com/odeke-em/drive/issues/535). 337 A use case might be ignoring all but say .bashrc files or .dotfiles. 338 To enable this, prefix "!" at the beginning of the path to achieve this behavior. 339 340#### Sample .driveignore with the exclude and include clauses combined 341```shell 342cat << $ >> .driveignore 343> ^\. 344> !^\.bashrc # .bashrc files won't be ignored 345> _export$ # _export files are to be ignored 346> !must_export$ # the exception to the clause anything with "must_export"$ won't be ignored 347``` 348 349### Pulling 350 351The `pull` command downloads data that does not exist locally but does remotely on Google drive, and may delete local data that is not present on Google Drive. 352Run it without any arguments to pull all of the files from the current path: 353 354```shell 355drive pull 356``` 357 358To pull and decrypt your data that is stored encrypted at rest on Google Drive, use flag `-decryption-password`: 359 360See [Issue #543](https://github.com/odeke-em/drive/issues/543) 361 362```shell 363drive pull -decryption-password '$JiME5Umf' influx.txt 364``` 365 366Pulling by matches is also supported 367 368```shell 369cd ~/myDrive/content/2015 370drive pull -matches vines docx 371``` 372 373To force download from paths that otherwise would be marked with no-changes 374 375```shell 376drive pull -force 377``` 378 379To pull specific files or directories, pass in one or more paths: 380 381```shell 382drive pull photos/img001.png docs 383``` 384 385Pulling by id is also supported 386 387```shell 388drive pull -id 0fM9rt0Yc9RTPaDdsNzg1dXVjM0E 0fM9rt0Yc9RTPaTVGc1pzODN1NjQ 0fM9rt0Yc9RTPV1NaNFp5WlV3dlU 389``` 390 391`pull` optionally allows you to pull content up to a desired depth. 392 393Say you would like to get just folder items until the second level 394 395```shell 396drive pull -depth 2 heavy-files summaries 397``` 398 399Traverse deep to infinity and beyond 400 401```shell 402drive pull -depth -1 all-my-files 403``` 404 405Pulling starred files is allowed as well 406 407```shell 408drive pull -starred 409drive pull -starred -matches content 410drive pull -starred -all # Pull all the starred files that aren't in the trash 411drive pull -starred -all -trashed # Pull all the starred files in the trash 412``` 413 414Like most commands [.driveignore](#excluding-and-including-objects) can be used to filter which files to pull. 415 416+ Note: Use `drive pull -hidden` to also pull files starting with `.` like `.git`. 417 418To selectively pull by type e.g file vs directory/folder, you can use flags 419- `files` 420- `directories` 421 422```shell 423drive pull -files a1/b2 424drive pull -directories tf1 425``` 426 427#### Verifying Checksums 428Due to popular demand, by default, checksum verification is turned off. It was deemed to be quite vigorous and unnecessary for most cases, in which size + modTime differences are sufficient to detect file changes. The discussion stemmed from issue [#117](https://github.com/odeke-em/drive/issues/117). 429 430However, modTime differences on their own do not warrant a resync of the contents of file. 431Modification time changes are operations of their own and can be made: 432+ locally by, touching a file (chtimes). 433+ remotely by just changing the modTime meta data. 434 435To turn checksum verification back on: 436 437```shell 438drive pull -ignore-checksum=false 439``` 440 441drive also supports piping pulled content to stdout which can be accomplished by: 442 443```shell 444drive pull -piped path1 path2 445``` 446 447+ In relation to issue #529, you can change the max retry counts for exponential backoff. Using a count < 0 falls back to the 448default count of 20: 449```shell 450drive pull -retry-count 14 documents/2016/March videos/2013/September 451``` 452 453#### Exporting Docs 454 455By default, the `pull` command will export Google Docs documents as PDF files. To specify other formats, use the `-export` option: 456 457```shell 458drive pull -export pdf,rtf,docx,txt 459``` 460 461To explicitly export instead of using `-force` 462 463```shell 464drive pull -export pdf,rtf,docx,txt -explicitly-export 465``` 466 467By default, the exported files will be placed in a new directory suffixed by `\_exports` in the same path. To export the files to a different directory, use the `-exports-dir` option: 468 469```shell 470drive pull -export pdf,rtf,docx,txt -exports-dir ~/Desktop/exports 471``` 472 473Otherwise, you can export files to the same directory as requested in [issue #660](https://github.com/odeke-em/drive/issues/660), 474by using pull flag `-same-exports-dir`. For example: 475```shell 476drive pull -explicitly-export -exports-dir ~/Desktop/exp -export pdf,txt,odt -same-exports-dir 477Resolving... 478+ /test-exports/few.docs 479+ /test-exports/few 480+ /test-exports/influx 481Addition count 3 482Proceed with the changes? [Y/n]:y 483Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-exports/influx' to '/Users/emmanuelodeke/Desktop/exp/influx.pdf' 484Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-exports/influx' to '/Users/emmanuelodeke/Desktop/exp/influx.txt' 485Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-exports/few' to '/Users/emmanuelodeke/Desktop/exp/few.pdf' 486Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-exports/few.docs' to '/Users/emmanuelodeke/Desktop/exp/few.docs.txt' 487Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-exports/few.docs' to '/Users/emmanuelodeke/Desktop/exp/few.docs.odt' 488Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-exports/few.docs' to '/Users/emmanuelodeke/Desktop/exp/few.docs.pdf' 489``` 490 491**Supported formats:** 492 493* doc, docx 494* jpeg, jpg 495* gif 496* html 497* odt 498* ods 499* rtf 500* pdf 501* png 502* ppt, pptx 503* svg 504* txt, text 505* xls, xlsx 506 507### Pushing 508 509The `push` command uploads data to Google Drive to mirror data stored locally. 510 511Like `pull`, you can run it without any arguments to push all of the files from the current path, or you can pass in one or more paths to push specific files or directories. 512 513`push` also allows you to push content up to a desired traversal depth e.g 514 515```shell 516drive push -depth 1 head-folders 517``` 518 519`drive push path` expects the path to be within the context of the drive. If the drive is locally at `~/grdrive`, `drive push ~/xyz.txt` may not execute as desired. Each path should reference a file or directory under the root directory of the mounted directory. 520 521You can also push multiple paths that are children of the root of the mounted drive to a destination, 522 523in relation to issue #612, using key `-destination`: 524 525For example to push the content of `music/Travi$+Future`, `integrals/complex/compilations` directly to `a1/b2/c3`: 526 527```shell 528drive push -destination a1/b2/c3 music/Travi$+Future integrals/complex/compilations 529``` 530 531To enable checksum verification during a push: 532 533```shell 534drive push -ignore-checksum=false 535``` 536 537To keep your data encrypted at rest remotely on Google Drive: 538 539```shell 540drive push -encryption-password '$JiME5Umf' influx.txt 541``` 542For E2E discussions, see [issue #543](https://github.com/odeke-em/issues/543): 543 544drive also supports pushing content piped from stdin which can be accomplished by: 545 546```shell 547drive push -piped path 548``` 549 550To selectively push by type e.g file vs directory/folder, you can use flags 551- `files` 552- `directories` 553 554```shell 555drive push -files a1/b2 556drive push -directories tf1 557``` 558 559Like most commands [.driveignore](#excluding-and-including-objects) can be used to filter which files to push. 560 561+ Note: Use `drive push -hidden` to also push files starting with `.` like `.git`. 562 563Here is an example using drive to backup the current working directory. It pushes a tar.gz archive created on the fly. No archive file is made on the machine running the command, so it doesn't waste disk space. 564 565```shell 566tar czf - . | drive push -piped backup-$(date +"%m-%d-%Y-"%T"").tar.gz 567``` 568 569+ Note: 570 * In response to [#107](https://github.com/odeke-em/drive/issues/107) and numerous other issues related to confusion about clashing paths, drive can now auto-rename clashing files. Use flag `-fix-clashes` during a `pull` or `push`, and drive will try to rename clashing files by adding a unique suffix at the end of the name, but right before the extension of a file (if the extension exists). If you haven't passed in the above `-fix-clashes` flag, drive will abort on trying to deal with clashing names. If you'd like to turn off this safety, pass in flag `-ignore-name-clashes` 571 * In relation to [#57](https://github.com/odeke-em/drive/issues/57) and [@rakyll's #49](https://github.com/rakyll/drive/issues/49). 572 A couple of scenarios in which data was getting totally clobbered and unrecoverable, drive now tries to play it safe and warn you if your data could potentially be lost e.g during a to-disk clobber for which you have no backup. At least with a push you have the luxury of untrashing content. To disable this safety, run drive with flag `-ignore-conflict` e.g: 573 574 ```shell 575 drive pull -ignore-conflict collaboration_documents 576 ``` 577 578 Playing the safety card even more, if you want to get changes that are non clobberable ie only additions 579 run drive with flag `-no-clobber` e.g: 580 581 ```shell 582 drive pull -no-clobber Makefile 583 ``` 584 585 * Ordinarily your system will not traverse nested symlinks e.g: 586 ```shell 587 mkdir -p a/b 588 mkdir -p ~/Desktop/z1/z2 && ls ~ > ~/Desktop/z1/z2/listing.txt 589 ln -s ~/Desktop/z1/z2 a/b 590 ls -R a # Should print only z2 and nothing inside it. 591 ``` 592 593 However in relation to [#80](https://github.com/odeke-em/drive/issues/80), for purposes of consistency with your Drive, traversing symlinks has been added. 594 595For safety with non clobberable changes i.e only additions: 596 597```shell 598drive push -no-clobber 599``` 600 601+ Due to the reasons above, drive should be able to warn you in case of total clobbers on data. To turn off this behaviour/safety, pass in the `-ignore-conflict` flag i.e: 602 603```shell 604drive push -force sure_of_content 605``` 606 607To push without user input (i.e. without prompt) 608```shell 609drive push -quiet 610``` 611or 612```shell 613drive push -no-prompt 614``` 615 616To get Google Drive to convert a file to its native Google Docs format 617 618```shell 619drive push -convert 620``` 621Extra features: to make Google Drive attempt Optical Character Recognition (OCR) for png, gif, pdf and jpg files. 622 623```shell 624drive push -ocr 625``` 626Note: To use OCR, your account should have this feature. You can find out if your account has OCR allowed. 627 628```shell 629drive features 630``` 631 632### Pulling And Pushing Notes 633 634+ MimeType inference is from the file's extension. 635 636 If you would like to coerce a certain mimeType that you'd prefer to assert with Google Drive pushes, use flag `-coerce-mime <short-key>` See [List of MIME type short keys](https://github.com/odeke-em/drive/wiki/List-of-MIME-type-short-keys) for the full list of short keys. 637 638```shell 639drive push -coerce-mime docx my_test_doc 640``` 641 642+ Excluding certain operations can be done both for pull and push by passing in flag 643`-exclude-ops` <csv_crud_values> 644 645e.g 646 647```shell 648drive pull -exclude-ops "delete,update" vines 649drive push -exclude-ops "create" sensitive_files 650``` 651 652+ To show more information during pushes or pulls e.g show the current operation, 653pass in option `-verbose` e.g: 654 655```shell 656drive pull -verbose 2015/Photos content 657drive push -verbose Music Fall2014 658``` 659 660+ In relation to issue #529, you can change the max retry counts for exponential backoff. Using a count < 0 falls back to the 661default count of 20: 662```shell 663drive push -retry-count 4 a/bc/def terms 664``` 665 666* You can also specify the upload chunk size to be used to push each file, by using flag 667`-upload-chunk-size` whose value is in bytes. If you don't specify this flag, by default 668the internal Google APIs use a value of 8MiB from constant `googleapi.DefaultUploadChunkSize`. 669Please note that your value has to be a multiple of and atleast the minimum upload chunksize 670of 256KiB from constant `googleapi.MinUploadChunkSize`. See https://godoc.org/google.golang.org/api/googleapi#pkg-constants. 671 If `-upload-chunk-size` is not set yet `-upload-rate-limit` is, `-upload-chunk-size` will be the same as `-upload-rate-limit`. 672 673* To limit the upload bandwidth, please set `-upload-rate-limit=n`. It's in `n` KiB/s, default is unlimited. 674 675### End to End Encryption 676 677See [Issue #543](https://github.com/odeke-em/drive/issues/543) 678 679This can be toggled when you supply a non-empty password ie 680 681- `-encryption-password` for a push. 682- `-decryption-password` for a pull. 683 684When you supply argument `-encryption-password` during a push, drive will encrypt your data 685and store it remotely encrypted(stored encrypted at rest), it can only be decrypted by you when you 686perform a pull with the respective arg `-decryption-password`. 687 688```shell 689drive push -encryption-password '$400lsGO1Di3' few-ones.mp4 newest.mkv 690``` 691 692```shell 693drive pull -decryption-password '$400lsGO1Di3' few-ones.mp4 newest.mkv 694``` 695 696If you supply the wrong password, you'll be warned if it cannot be decrypted 697 698```shell 699$ drive pull -decryption-password "4nG5troM" few-ones.mp4 newest.mkv 700message corrupt or incorrect password 701``` 702 703To pull normally push or pull your content, without attempting any *cryption attempts, skip 704passing in a password and no attempts will be made. 705 706### Publishing 707 708The `pub` command publishes a file or directory globally so that anyone can view it on the web using the link returned. 709 710```shell 711drive pub photos 712``` 713 714+ Publishing by fileId is also supported 715 716```shell 717drive pub -id 0fM9rt0Yc9RTPV1NaNFp5WlV3dlU 0fM9rt0Yc9RTPSTZEanBsamZjUXM 718``` 719 720### Unpublishing 721 722The `unpub` command is the opposite of `pub`. It unpublishes a previously published file or directory. 723 724```shell 725drive unpub photos 726``` 727 728+ Publishing by fileId is also supported 729 730```shell 731drive unpub -id 0fM9rt0Yc9RTPV1NaNFp5WlV3dlU 0fM9rt0Yc9RTPSTZEanBsamZjUXM 732``` 733 734### Sharing and Emailing 735 736The `share` command enables you to share a set of files with specific users and assign them specific roles as well as specific generic access to the files. It also allows for email notifications on share. 737 738```shell 739drive share -emails odeke@ualberta.ca,odeke.ex@gmail.com -message "This is the substring file I told you about" -role reader,writer -type group mnt/substringfinder.c projects/kmp.c 740$ drive share -emails emm.odeke@gmail.com,odeke@ualberta.ca -role reader,commenter -type user influx traversal/notes/conquest 741``` 742 743For example to share a file with users of a mailing list and a custom message 744 745```shell 746drive share -emails drive-mailing-list@gmail.com -message "Here is the drive code" -role group mnt/drive 747``` 748 749+ By default, an email notification is sent (even if -message is not specfified). To turn off email notification, use -notify=false 750 751```shell 752$ drive share -notify=false -emails emm.odeke@gmail.com,odeke@ualberta.ca -role reader,commenter -type user influx traversal/notes/conquest 753``` 754 755+ The `share` command also supports sharing by fileId 756 757```shell 758drive share -emails developers@developers.devs -message "Developers, developers developers" -id 0fM9rt0Yc9RTPeHRfRHRRU0dIY97 0fM9rt0Yc9kJRPSTFNk9kSTVvb0U 759``` 760 761+ You can also share a file to only those with the link. As per [https://github.com/odeke-em/drive/issues/568](https://github.com/odeke-em/drive/issues/568), this file won't be publicly indexed. To turn this option on when sharing the file, 762use flag `-with-link`. 763 764```shell 765drive share -with-link ComedyPunchlineDrumSound.mp3 766``` 767 768### Unsharing 769 770The `unshare` command revokes access of a specific accountType to a set of files. 771 772When no -role is given it by default assumes you want to revoke all access ie "reader", "writer", "commenter" 773 774```shell 775drive unshare -type group mnt/drive 776drive unshare -emails emm.odeke@gmail.com,odeke@ualberta.ca -type user,group -role reader,commenter infinity newfiles/confidential 777``` 778 779+ Also supports unsharing by fileId 780 781```shell 782drive unshare -type group -id 0fM9rt0Yc9RTPeHRfRHRRU0dIY97 0fM9rt0Yc9kJRPSTFNk9kSTVvb0U 783``` 784 785### Starring Or Unstarring 786 787To star or unstar documents, 788 789```shell 790drive star information quest/A/B/C 791drive star -id 0fM9rt0Yc9RTPaDdsNzg1dXVjM0E 0fM9rt0Yc9RTPaTVGc1pzODN1NjQ 0fM9rt0Yc9RTPV1NaNFp5WlV3dlU 792``` 793 794```shell 795drive unstar information quest/A/B/C 796drive unstar -id 0fM9rt0Yc9RTPaDdsNzg1dXVjM0E 0fM9rt0Yc9RTPaTVGc1pzODN1NjQ 0fM9rt0Yc9RTPV1NaNFp5WlV3dlU 797``` 798 799### Diffing 800 801The `diff` command compares local files with their remote equivalents. It allows for multiple paths to be passed in e.g 802 803```shell 804drive diff changeLogs.log notes sub-folders/ 805``` 806 807You can diff to a desired depth 808 809```shell 810drive diff -depth 2 sub-folders/ contacts/ listings.txt 811``` 812 813You can also switch the base, either local or remote by using flag `-base-local` 814 815```shell 816drive diff -base-local=true assignments photos # To use local as the base 817drive diff -base-local=false infocom photos # To use remote as the base 818``` 819 820You can only diff for short changes that is only name differences, file modTimes and types, you can use flag `-skip-content-check`. 821 822```shell 823drive diff -skip-content-check 824``` 825 826### Touching 827 828Files that exist remotely can be touched i.e their modification time updated to that on the remote server using the `touch` command: 829 830```shell 831drive touch Photos/img001.png logs/log9907.txt 832``` 833 834For example to touch all files that begin with digits 0 to 9: 835 836```shell 837drive touch -matches $(seq 0 9) 838``` 839 840+ Also supports touching of files by fileId 841 842```shell 843drive touch -id 0fM9rt0Yc9RTPeHRfRHRRU0dIY97 0fM9rt0Yc9kJRPSTFNk9kSTVvb0U 844``` 845 846+ You can also touch files to a desired depth of nesting within their parent folders. 847 848```shell 849drive touch -depth 3 mnt newest flux 850drive touch -depth -1 -id 0fM9rt0Yc9RTPeHRfRHRRU0dIY97 0fM9rt0Yc9kJRPSTFNk9kSTVvb0U 851drive touch -depth 1 -matches $(seq 0 9) 852``` 853 854+ You can also touch and explicitly set the modification time for files by: 855```shell 856drive touch -time 20120202120000 ComedyPunchlineDrumSound.mp3 857/share-testing/ComedyPunchlineDrumSound.mp3: 2012-02-02 12:00:00 +0000 UTC 858``` 859 860+ Specify the time format that you'd like to use when specifying the time e.g 861```shell 862drive touch -format "2006-01-02-15:04:05.0000Z" -time "2016-02-03-08:12:15.0070Z" outf.go 863/share-testing/outf.go: 2016-02-03 08:12:15 +0000 UTC 864``` 865The mentioned time format has to be relative to how you would represent 866"Mon Jan 2 15:04:05 -0700 MST 2006". 867See the documentation for time formatting here [time.Parse](https://golang.org/pkg/time/#Parse) 868 869+ Specify the touch time offset from the clock on your machine where: 870- minus(-) means ago e.g 30 hours ago -> -30h 871- blank or plus(+) means from now e.g 10 minutes -> 10m or +10m 872```shell 873drive touch -duration -30h ComedyPunchlineDrumSound.mp3 outf.go 874/share-testing/outf.go: 2016-09-10 08:06:39 +0000 UTC 875/share-testing/ComedyPunchlineDrumSound.mp3: 2016-09-10 08:06:39 +0000 UTC 876``` 877 878### Trashing And Untrashing 879 880Files can be trashed using the `trash` command: 881 882```shell 883drive trash Demo 884``` 885 886To trash files that contain a prefix match e.g all files that begin with Untitled, or Make 887 888Note: This option uses the current working directory as the parent that the paths belong to. 889 890```shell 891drive trash -matches Untitled Make 892``` 893 894Files that have been trashed can be restored using the `untrash` command: 895 896```shell 897drive untrash Demo 898``` 899 900To untrash files that match a certain prefix pattern 901 902```shell 903drive untrash -matches pQueue photos Untitled 904``` 905 906+ Also supports trashing/untrashing by fileId 907 908```shell 909drive trash -id 0fM9rt0Yc9RTPeHRfRHRRU0dIY97 0fM9rt0Yc9kJRPSTFNk9kSTVvb0U 910drive untrash -id 0fM9rt0Yc9RTPeHRfRHRRU0dIY97 0fM9rt0Yc9kJRPSTFNk9kSTVvb0U 911``` 912 913### Emptying The Trash 914 915Emptying the trash will permanently delete all trashed files. Caution: They cannot be recovered after running this command. 916 917```shell 918drive emptytrash 919``` 920 921### Deleting 922 923Deleting items will PERMANENTLY remove the items from your drive. This operation is irreversible. 924 925```shell 926drive delete flux.mp4 927``` 928 929```shell 930drive delete -matches onyx swp 931``` 932 933+ Also supports deletion by fileIds 934 935```shell 936drive delete -id 0fM9rt0Yc9RTPeHRfRHRRU0dIY97 0fM9rt0Yc9kJRPSTFNk9kSTVvb0U 937``` 938 939### Listing 940 941The `list` command shows a paginated list of files present remotely. 942 943Run it without arguments to list all files in the current directory's remote equivalent: 944 945```shell 946drive list 947``` 948 949Pass in a directory path to list files in that directory: 950 951```shell 952drive list photos 953``` 954 955To list matches 956 957```shell 958drive list -matches mp4 go 959``` 960 961The `-trashed` option can be specified to show trashed files in the listing: 962 963```shell 964drive list -trashed photos 965``` 966 967To get detailed information about the listings e.g owner information and the version number of all listed files: 968 969```shell 970drive list -owners -l -version 971``` 972 973+ Also supports listing by fileIds 974 975```shell 976drive list -depth 3 -id 0fM9rt0Yc9RTPeHRfRHRRU0dIY97 0fM9rt0Yc9kJRPSTFNk9kSTVvb0U 977``` 978 979+ Listing allows for sorting by fields e.g `name`, `version`, `size, `modtime`, lastModifiedByMeTime `lvt`, `md5`. To do this in reverse order, suffix `_r` or `-` to the selected key 980 981e.g to first sort by modTime, then largest-to-smallest and finally most number of saves: 982 983``` 984drive list -sort modtime,size_r,version_r Photos 985``` 986 987* For advanced listing 988 989```shell 990drive list -skip-mime mp4,doc,txt 991drive list -match-mime xls,docx 992drive list -exact-title url_test,Photos 993``` 994 995### Stating 996 997The `stat` commands show detailed file information for example people with whom it is shared, their roles and accountTypes, and 998fileId etc. It is useful to help determine whom and what you want to be set when performing share/unshare 999 1000```shell 1001drive stat mnt 1002``` 1003 1004By default `stat` won't recursively stat a directory, to enable recursive stating: 1005 1006```shell 1007drive stat -r mnt 1008``` 1009 1010+ Also supports stat-ing by fileIds 1011 1012```shell 1013drive stat -r -id 0fM9rt0Yc9RTPeHRfRHRRU0dIY97 0fM9rt0Yc9kJRPSTFNk9kSTVvb0U 1014``` 1015 1016OR 1017 1018```shell 1019drive stat -depth 4 -id 0fM9rt0Yc9RTPeHRfRHRRU0dIY97 0fM9rt0Yc9kJRPSTFNk9kSTVvb0U 1020``` 1021 1022### Printing URL 1023 1024The url command prints out the url of a file. It allows you to specify multiple paths relative to root or even by id 1025 1026```shell 1027drive url Photos/2015/07/Releases intros/flux 1028drive url -id 0Bz5qQkvRAeVEV0JtZl4zVUZFWWx 1Pwu8lzYc9RTPTEpwYjhRMnlSbDQ 0Cz5qUrvDBeX4RUFFbFZ5UXhKZm8 1029``` 1030 1031### Editing Description 1032 1033You can edit the description of a file like this 1034 1035```shell 1036drive edit-desc -description "This is a new file description" freshFolders/1.txt commonCore/ 1037drive edit-description -description "This is a new file description" freshFolders/1.txt commonCore/ 1038``` 1039 1040Even more conveniently by piping content 1041 1042```shell 1043cat fileDescriptions | drive edit-desc -piped targetFile influx/1.txt 1044``` 1045 1046### Retrieving MD5 Checksums 1047 1048The `md5sum` command quickly retrieves the md5 checksums of the files on your drive. The result can be fed into the "md5sum -c" shell command to validate the integrity of the files on Drive versus the local copies. 1049 1050Check that files on Drive are present and match local files: 1051 1052```shell 1053~/MyDrive/folder$ drive md5sum | md5sum -c 1054``` 1055 1056Do a two-way diff (will also locate files missing on either side) 1057 1058```shell 1059~/MyDrive/folder$ diff <(drive md5sum) <(md5sum *) 1060``` 1061 1062Same as above, but include subfolders 1063 1064```shell 1065~/MyDrive/folder$ diff <(drive md5sum -r) <(find * -type f | sort | xargs md5sum) 1066``` 1067 1068Compare across two different Drive accounts, including subfolders 1069 1070```shell 1071~$ diff <(drive md5sum -r MyDrive/folder) <(drive md5sum -r OtherDrive/otherfolder) 1072``` 1073 1074* Note: Running the 'drive md5sum' command retrieves pre-computed md5 sums from Drive; its speed is proportional to the number of files on Drive. Running the shell 'md5sum' command on local files requires reading through the files; its speed is proportional to the size of the files._ 1075 1076### Retrieving FileId 1077 1078You can retrieve just the fileId for specified paths 1079```shell 1080drive id [-depth n] [paths...] 1081drive file-id [-depth n] [paths...] 1082``` 1083 1084For example: 1085 1086```shell 1087drive file-id -depth 2 dup-tests bug-reproductions 1088# drive file-id -depth 2 dup-tests bug-reproductions 1089FileId Relative Path 1090"0By5qKlgRJeV2NB1OTlpmSkg8TFU" "/dup-tests" 1091"0Bz5wQlgRJeP2QkRSenBTaUowU3c" "/dup-tests/influx_0" 1092"0Cu5wQlgRJeV2d2VmY29HV217TFE" "/dup-tests/a" 1093"0Cy5wQlgRJeX2WXVFMnQyQ2NDRTQ" "/dup-tests/influx" 1094"0Cy5wQlgRJeP2YGMiOC15OEpUZnM" "/bug-reproductions" 1095"0Cy5wQlgRJeV2MzFtTm50NVV5NW8" "/bug-reproductions/drive-406" 1096"1xmXPziMPEgq2dK-JqaUytKz_By8S_7_RVY79ceRoZwv" "info-bulletins" 1097``` 1098 1099### Retrieving Quota 1100 1101The `quota` command prints information about your drive, such as the account type, bytes used/free, and the total amount of storage available. 1102 1103```shell 1104drive quota 1105``` 1106 1107### Retrieving Features 1108 1109The `features` command provides information about the features present on the 1110drive being queried and the request limit in queries per second 1111 1112```shell 1113drive features 1114``` 1115 1116### Creating 1117 1118drive allows you to create an empty file or folder remotely 1119Sample usage: 1120 1121```shell 1122drive new -folder flux 1123drive new -mime-key doc bofx 1124drive new -mime-key folder content 1125drive new -mime-key presentation ProjectsPresentation 1126drive new -mime-key sheet Hours2015Sept 1127drive new -mime-key form taxForm2016 taxFormCounty 1128drive new flux.txt oxen.pdf # Allow auto type resolution from the extension 1129``` 1130 1131### Opening 1132 1133The open command allows for files to be opened by the default file browser, default web browser, either by path or by id for paths that exist atleast remotely 1134 1135```shell 1136drive open -file-browser=false -web-browser f1/f2/f3 jamaican.mp4 1137drive open -file-browser -id 0Bz8qQkpZAeV9T1PObvs2Y3BMQEj 0Y9jtQkpXAeV9M1PObvs4Y3BNRFk 1138``` 1139 1140### Copying 1141 1142drive allows you to copy content remotely without having to explicitly download and then reupload. 1143 1144```shell 1145drive copy -r blobStore.py mnt flagging 1146``` 1147 1148```shell 1149drive copy blobStore.py blobStoreDuplicated.py 1150``` 1151 1152+ Also supports copying by fileIds 1153 1154```shell 1155drive copy -r -id 0fM9rt0Yc9RTPeHRfRHRRU0dIY97 0fM9rt0Yc9kJRPSTFNk9kSTVvb0U ../content 1156``` 1157 1158### Moving 1159 1160drive allows you to move content remotely between folders. To do so: 1161 1162```shell 1163drive move photos/2015 angles library archives/storage 1164``` 1165 1166+ Also supports moving by fileId 1167 1168```shell 1169drive move -id 0fM9rt0Yc9RTPeHRfRHRRU0dIY97 0fM9rt0Yc9kJRPSTFNk9kSTVvb0U ../../new_location 1170``` 1171 1172Google Drive supports multi-parent folder structure, where one file/folder can be placed in more than one parent folder. 1173It consumes no extra disk space on the Cloud, but after pulling such structure it may double your files several times in your file structure. 1174Pushing non deduplicated folder structures back may also break things, so be careful. 1175 1176To place file/folder into new parent folder, keeping old one as well, use `-keep-parent` option 1177 1178```shell 1179$ drive move -keep-parent photos/2015 angles library second_parent_folder 1180``` 1181 1182### Renaming 1183 1184drive allows you to rename a file/folder remotely. 1185Two arguments are required to rename ie `<relativePath/To/source or Id>` `<newName>`. 1186 1187To perform a rename: 1188 1189```shell 1190drive rename url_test url_test_results 1191drive rename openSrc/2015 2015-Contributions 1192``` 1193 1194+ Also supports renaming by fileId 1195 1196```shell 1197drive rename 0fM9rt0Yc9RTPeHRfRHRRU0dIY97 fluxing 1198``` 1199 1200To turn off renaming locally or remotely, use flags 1201`-local=false` or `-remote=false`. By default both are turned on. 1202 1203For example 1204 1205```shell 1206drive rename -local=false -remote=true a/b/c/d/e/f flux 1207``` 1208 1209### Command Aliases 1210 1211`drive` supports a few aliases to make usage familiar to the utilities in your shell e.g: 1212+ cp : copy 1213+ ls : list 1214+ mv : move 1215+ rm : delete 1216 1217### Detecting And Fixing Clashes 1218 1219You can deal with clashes by using command `drive clashes`. 1220 1221* To list clashes, you can do 1222 1223```shell 1224drive clashes [-depth n] [paths...] 1225drive clashes -list [-depth n] [paths...] # To be more explicit 1226``` 1227 1228* To fix clashes, you can do: 1229 1230``` 1231drive clashes -fix [-fix-mode mode] [-depth n] [paths...] 1232``` 1233 1234There are two available modes for `-fix-mode`: 1235 * `rename`: this is the default behavior 1236 * `trash`: trashing *both* new and old files 1237 1238## .desktop Files 1239 1240As previously mentioned, Google Docs, Drawings, Presentations, Sheets etc and all files affiliated 1241with docs.google.com cannot be downloaded raw but only exported. Due to popular demand, Linux users 1242desire the ability to have \*.desktop files that enable the file to be opened appropriately by an external opener. 1243Thus by default on Linux, drive will create \*.desktop files for files that fall into this category. 1244 1245To turn off this behavior, you can set flag `-desktop-links` to false e.g 1246```shell 1247drive pull -desktop-links=false 1248``` 1249 1250### Fetching And Pruning Missing Index Files 1251 1252* index 1253 1254If you would like to fetch missing index files for files that would otherwise not need any modifications, run: 1255 1256```shell 1257drive index path1 path2 path3/path3.1 # To fetch any missing indices in those paths 1258drive index -id 0CLu4lbUI9RTRM80k8EMoe5JQY2z 1259``` 1260 1261You can also fetch specific files by prefix matches 1262```shell 1263drive index -matches mp3 jpg 1264``` 1265 1266* prune 1267 1268In case you might have deleted files remotely but never using drive, and feel like you have stale indices, 1269running `drive index -prune` will search your entire indices dir for index files that do not exist remotely and remove those ones 1270 1271```shell 1272drive index -prune 1273``` 1274 1275* prune-and-index 1276To combine both operations (prune and then fetch) for indices: 1277 1278```shell 1279drive index -all-ops 1280``` 1281 1282### Drive server 1283 1284To enable services like qr-code sharing, you'll need to have the server running that will serve content once invoked in a web browser to allow for resources to be accessed on another device e.g your mobile phone 1285 1286```shell 1287go get github.com/odeke-em/drive/drive-server && drive-server 1288drive-server 1289``` 1290 1291Pre-requisites: 1292 + DRIVE\_SERVER\_PUB\_KEY 1293 + DRIVE\_SERVER\_PRIV\_KEY 1294 1295Optionally 1296 + DRIVE\_SERVER\_PORT : default is 8010 1297 + DRIVE\_SERVER\_HOST : default is localhost 1298 1299If the above keys are not set in your env, you can do this 1300 1301```shell 1302DRIVE_SERVER_PUB_KEY=<pub_key> DRIVE_SERVER_PRIV_KEY=<priv_key> [DRIVE...] drive-server 1303``` 1304 1305### QR Code Share 1306 1307Instead of traditionally copying long links, drive can now allow you to share a link to a file by means of a QR code that is generated after a redirect through your web browser. 1308 1309From then on, you can use your mobile device or any other QR code reader to get to that file. 1310In order for this to run, you have to have the `drive-server` running 1311 1312As long as the server is running on a known domain, then you can start the qr-link getting ie 1313 1314```shell 1315drive qr vines/kevin-hart.mp4 notes/caches.pdf 1316drive qr -address http://192.168.1.113:8010 books/newest.pdf maps/infoGraphic.png 1317drive qr -address https://my.server books/newest.pdf maps/infoGraphic.png 1318``` 1319 1320That should open up a browser with the QR code that when scanned will open up the desired file. 1321 1322### About 1323 1324The `about` command provides information about the program as well as that about 1325your Google Drive. Think of it as a hybrid between the `features` and `quota` commands. 1326```shell 1327drive about 1328``` 1329 1330OR for detailed information 1331```shell 1332drive about -features -quota 1333``` 1334 1335### Help 1336 1337Run the `help` command without any arguments to see information about the commands that are available: 1338 1339```shell 1340drive help 1341``` 1342 1343Pass in the name of a command to get information about that specific command and the options that can be passed to it. 1344 1345```shell 1346drive help push 1347``` 1348 1349To get help for all the commands 1350```shell 1351drive help all 1352``` 1353 1354### Filing Issues 1355 1356In case of any issue, you can file one by using command `issue` aka `report-issue` aka `report`. 1357It takes flags `-title` `-body` `-piped`. 1358 1359* If `-piped` is set, it expects to read the body from standard input. 1360 1361A successful issue-filing request will open up the project's issue tracker in your web browser. 1362 1363``` 1364drive issue -title "Can't open my file" -body "Drive trips out every time" 1365drive report-issue -title "Can't open my file" -body "Drive trips out every time" 1366cat bugReport.txt | drive issue -piped -title "push: dump on pushing from this directory" 1367``` 1368 1369### Revoking Account Access 1370 1371To revoke OAuth Access of drive to your account, when logged in with your Google account, go to https://security.google.com/settings/security/permissions and revoke the desired permissions 1372 1373### Uninstalling 1374 1375To remove `drive` from your computer, you'll need to take out: 1376+ $GOPATH/bin/drive 1377+ $GOPATH/src/github.com/odeke-em/drive 1378+ $GOPATH/pkg/github.com/odeke-em/drive 1379+ $GOPATH/pkg/github.com/odeke-em/drive.a 1380 1381* Also do not forget to revoke drive's access in case you need to uninstall it. 1382 1383## Applying Patches 1384To apply patches of code e.g in the midst of bug fixes, you'll just need a little bit of git fiddling. 1385 1386For example to patch your code with that on remote branch patch-1, you'll need to go into the source 1387code directory, fetch all content from the git remote, checkout the patch branch then run the go installation: something like this. 1388 1389```shell 1390cd $GOPATH/src/github.com/odeke-em/drive 1391git fetch --all 1392git checkout patch-1 1393git pull origin patch-1 1394go get github.com/odeke-em/drive/cmd/drive 1395``` 1396 1397## Why Another Google Drive Client? 1398 1399Background sync is not just hard, it is stupid. Here are my technical and philosophical rants about why it is not worth to implement: 1400 1401* Too racy. Data is shared between your remote resource, local disk and sometimes in your sync daemon's in-memory structs. Any party could touch a file at any time. It is hard to lock these actions. You end up working with multiple isolated copies of the same file and trying to determine which is the latest version that should be synced across different contexts. 1402 1403* It requires great scheduling to perform best with your existing environmental constraints. On the other hand, file attribute have an impact on the sync strategy. Large files block -- you wouldn't like to sit on and wait for a VM image to get synced before you can start working on a tiny text file. 1404 1405* It needs to read your mind to understand your priorities. Which file do you need most? It needs to read your mind to foresee your future actions. I'm editing a file, and saving the changes time to time. Why not to wait until I feel confident enough to commit the changes remotely? 1406 1407`drive` is not a sync daemon, it provides: 1408 1409* Upstreaming and downstreaming. Unlike a sync command, we provide pull and push actions. The user has the opportunity to decide what to do with their local copy and when they decide to. Make some changes, either push the file remotely or revert it to the remote version. You can perform these actions with user prompt: 1410 1411 echo "hello" > hello.txt 1412 drive push # pushes hello.txt to Google Drive 1413 echo "more text" >> hello.txt 1414 drive pull # overwrites the local changes with the remote version 1415 1416* Allowing to work with a specific file or directory, optionally not recursively. If you recently uploaded a large VM image to Google Drive, yet only a few text files are required for you to work, simply only push/pull the exact files you'd like to worth with: 1417 1418 echo "hello" > hello.txt 1419 drive push hello.txt # pushes only the specified file 1420 drive pull path/to/a/b path2/to/c/d/e # pulls the remote directory recursively 1421 1422* Better I/O scheduling. One of the major goals is to provide better scheduling to improve upload/download times. 1423 1424* Possibility to support multiple accounts. Pull from or push to multiple Google Drive remotes. Possibility to support multiple backends. Why not to push to Dropbox or Box as well? 1425 1426## Known Issues 1427 1428* It probably doesn't work on Windows. 1429* Google Drive allows a directory to contain files/directories with the same name. Client doesn't handle these cases yet. We don't recommend you to use `drive` if you have such files/directories to avoid data loss. 1430* Racing conditions occur if remote is being modified while we're trying to update the file. Google Drive provides resource versioning with ETags, use Etags to avoid racy cases. 1431* drive rejects reading from namedPipes because they could infinitely hang. See [issue #208](https://github.com/odeke-em/drive/issues/208). 1432 1433## Reaching Out 1434 1435Doing anything interesting with drive or want to share your favorite tips and tricks? Check out the [wiki](https://github.com/odeke-em/drive/wiki) and feel free to reach out with ideas for features or requests. 1436 1437## Disclaimer 1438 1439This project is not supported nor maintained by Google. 1440 1441## LICENSE 1442 1443Copyright 2013 Google Inc. All Rights Reserved. 1444 1445Licensed under the Apache License, Version 2.0 (the "License"); 1446you may not use this file except in compliance with the License. 1447You may obtain a copy of the License at 1448 1449 http://www.apache.org/licenses/LICENSE-2.0 1450 1451Unless required by applicable law or agreed to in writing, software 1452distributed under the License is distributed on an "AS IS" BASIS, 1453WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1454See the License for the specific language governing permissions and 1455limitations under the License. 1456