I’m trying to set up a bash script that backs up files from my server to Google Drive using the gdrive tool. The test credentials I got work fine but they’re limited to 100 uses. I’m not sure how to get permanent credentials from Google’s API website. They seem to focus on verified public apps. Is there a way to get private credentials just for my own use without having to make an app or share anything publicly? I don’t want to go through the whole app verification process for something I’ll use myself. Any ideas on how to get around this? Maybe there’s a setting I’m missing or a different type of credential I should be looking for?
hey, i’ve been using rclone for my google drive backups. it’s super easy to set up and doesn’t need the whole app verification thing. you just authorize it once on your machine and it creates a config file with the tokens. works great for personal use and scripts. might be worth checking out if gdrive is giving you trouble!
You’re in luck! There’s actually a way to get long-term credentials for personal use without going through the full app verification process. Look into creating a ‘service account’ in the Google Cloud Console. It’s designed for server-to-server interactions and doesn’t have usage limits like OAuth credentials do. You’ll get a JSON key file that you can use with gdrive or other API tools. Just be sure to keep that key file secure, as it grants access to your Drive. This approach is perfect for personal scripts and automation tasks. I’ve been using it for my own backup system for over a year now without any issues.
I’ve been down this road before, and I feel your frustration. After some trial and error, I found a workaround that might help. Instead of using the standard OAuth flow, you can set up a Google Cloud project and create what’s called a ‘service account.’ This gives you long-term credentials without the hassle of public verification.
Here’s the gist: Go to the Google Cloud Console, create a new project, enable the Drive API, and then create a service account. You’ll get a JSON key file that you can use with your bash script. It’s a bit more setup initially, but once it’s done, you’re good to go indefinitely.
Just remember to keep that JSON file secure - it’s essentially the keys to your Drive kingdom. And make sure you only grant it access to the specific Drive folders you need for your backups. It’s served me well for my personal backup needs without any of the OAuth headaches.