I am currently backing up my repositories to a local HDD drive. I’d now like to use the duplicacy copy command to copy the snapshots to google drive. However using a duplicacy-owned google app to control access is a total non-starter for me, so I’d like to use service account credentials using my own google project.
I’ve already checked here
I’ve also already checked here
In both of those posts you mention adding the service account email to the share list, but I’m running into the same problem the user from the first post is having - the snapshots get uploaded to the service account google drive, but not mine. Here is what I did to set things up:
- Created my own google application and service account by going to the link in the storage-backends article. I can only post 2 links because I’m a new user otherwise I’d post the link.
- Downloaded the service account JSON.
- In my own google drive account, that is, my personal non-gsuite google drive account, I create a folder named “DuplicacyBackups”.
- I share this DuplicacyBackups folder with the service account email, in this case duplicacy@duplicacy-backups.iam.gserviceaccount .com. This works just fine and google finds the service account.
- I now init this storage by running “duplicacy add -copy default google-drive testsnapshot gcd://DuplicacyBackups”
- I get prompted for the json file and give it the path to the service account file I downloaded earlier. Enter the path and it works fine.
- Run the backup using “duplicacy backup -storage google-drive”
The backup runs successfully. If I run duplicacy list -storage google-drive, it finds information and returns snapshot data.
BUT…
There are absolutely zero files in my “DuplicacyBackups” folder on my personal drive. I can restore snpashots from google drive, back up more revisions, it all works, but nothing shows up in my own google drive. After looking around it appears all the backup files got created in the service account’s google drive. Even though I shared my personal “DuplicacyBackups” folder with the service account, it seems the gcd://DuplicacyBackups path did not refer to the folder I created in my personal drive, but rather some folder that got automatically created under the service account’s drive.
Note that google drive recently changed the way they handle shared folders. It was in mid-2020 I believe. If someone shares a folder with me (or a service account), that folder no longer gets added to my drive as a simple folder. It’s now created as a shortcut - it’s nuanced but different from how it used to work.
I’m wondering if anyone has recently used a service account for a non-gsuite/workspace environment? Is it possible these new “shortcut” folder shares have broken duplicacy’s ability to use a service account without having domain-wide delegation that only workspace users can have, or am I just doing something obviously incorrect?