4

I wish to run a simple process on my server/laptop that will upload files to my google drive on a daily basis, once a day. I don't wish to share this, allow other users to use it etc.

All examples I find seem to involve browsing to an address to gain permission from the user (me) and then getting an auth code etc and proceding

ref: Java quickstart

  1. Is there a way/example to do this without need of a browser, getting permission getting unique auth code each time as I only want to do this for my account?
  2. Can I use a bash script with CURL commands rather than having to use Java?
user1843591
  • 1,074
  • 3
  • 17
  • 37

1 Answers1

2
  1. Yes. See How do I authorise an app (web or installed) without user intervention? (canonical ?)

  2. Yes. It becomes a complicated script if your file is large and you are doing resumable uploads, but for small files it's perfectly feasible. You'll need to play around a bit to get the correct encoding, multipart mime body, mime type and content size, but it's all eminently doable. You'll start by calling Google's auth api with your stored refresh token to get an access token. Then you'll set that access token into an Authorization bearer header as part of your content upload call.

Community
  • 1
  • 1
pinoyyid
  • 21,499
  • 14
  • 64
  • 115