Hello,
Is it possible setup gdrive with "Service account". Google gives you a json file to the service account info. The json has type, project_id, private_key_id etc etc
I want to setup daily cron to backup server and I don't want to manually authenticate.
hi, nice feature but i cant make it work in any way, please write some error message like file not found or key not valid
Hi,
there are already some error messages, for example if the service account file does not exists, I get this:
fdifabio$ ./gdrive -c /tmp --service-account foo.json about
Failed getting oauth client: Service account filename "/tmp/foo.json" not found
and others should be handled by the GDrive API directly, for example in case of invalid key:
fdifabio$ gdrive -c ~/tmp --service-account service_account.json about
Failed to get about: Get https://www.googleapis.com/drive/v3/about?alt=json&fields=maxImportSizes%2CmaxUploadSize%2CstorageQuota%2Cuser: private key should be a PEM or plain PKSC1 or PKCS8; parse error: asn1: structure error: tags don't match (16 vs {class:0 tag:13 length:45 isCompound:true}) {optional:false explicit:false application:false defaultValue:<nil> tag:<nil> stringType:0 timeType:0 set:false omitEmpty:false} pkcs1PrivateKey @2
Could you help me in reproducing you setup, so I can find what is missing?
Downloaded from https://github.com/prasmussen/gdrive/tree/2.1.0
./gdrive-linux-x64 -c /tmp --service-account foo.json about
No valid arguments given, use 'gdrive help' to see available commands
./gdrive-linux-x64 -c ~/tmp --service-account service_account.json about
No valid arguments given, use 'gdrive help' to see available commands
The build you are using does not have this new feature, since it is only available compiling sources from the master branch.
Please ask to @prasmussen when he plan to do a new binary release.
@fab-io,
I thought this was totally abandoned. Thanks for taking time. I appreciate it :)
I use "gdrive-linux-386" version from the main page but I don't think it's been released for it yet.
This absolutely just tripped me up too; @prasmussen do you have any plans when new builds (especially windows!) will be available?
Wow, this is confusing! It seems that raspberry pi build doesn't work with --service-account as well. Why there is no warning in README?! I spent an hour trying to make it work to find out it is not present in the binary...
$ ./gdrive-linux-rpi -c /tmp --service-account "creds.json" about
throws:
No valid arguments given, use 'gdrive help' to see available commands
Actually it's not that complex to compile the binary, I compiled one for Linux x64 (to be able to download it to an older distro, without recent Go)
gdrive-linux-x64.zip
Otherwise +1 for the new release, it would be needed.
Thanks for the link to the linux-x64 build. The --service-account option seems to be working for me.
+1 for this to be in the next release. THX again.
Here is a darwin/amd64 build that I put together on my mac. I'm completely new to go, so no guarantees...
gdrive_darwin_amd64.tar.gz
This is extremely confusing, I wasted too much time on it before I found this issue...
There hasn't been a release for a long time, fair enough, but why does the README then describe features that aren't even available in the suggested builds? There's nothing to even hint that what's described might not be in the build.
Also the No valid arguments given, use 'gdrive help' to see available commands error message is misleading because it occurs when at least some valid arguments are present. No indication of the --service-account flag being unknown.
@AronNovak it doesn't work with your binary as well as with binary from main page
+1 for getting a Raspberry Pi version of --service-account going. Spent an hour at least wrangling the Google service account, got the JSON file, but keep getting No valid arguments given...
Still not release in homebrew yet
Most helpful comment
Actually it's not that complex to compile the binary, I compiled one for Linux x64 (to be able to download it to an older distro, without recent Go)
gdrive-linux-x64.zip
Otherwise +1 for the new release, it would be needed.