-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Shared Google Drives #579
Conversation
A shared drive can be accessed via gcd://sharedDriveId@path/to/storage sharedDriveId is optional and if omitted duplicacy stores to the user's drive. This remains backwards compatible with existing drives. E.g. gcd://path/to/storage Note: Shared Drives were previously named Team Drives.
@rsanger very nice! Tried to rebuild duplicacy based on a |
@draimundo This is a carryover of existing drive behaviour (which doesn't make much sense). So you need to use at least: I will look into removing that limitation (or at least improving the error), as it doesn't make sense for shared drives. |
Allows writing to the drive root using: gcd://driveid@ or gcd://driveid@/ To write to the root of the default user's drive use the special shared drive named 'root': gcd://root@/
As per @draimundo's comment. |
any thoughts on when this will make it to a release? thanks |
I know its not in here and I'm not a golang programmer so I can't add it but the inclusion of using Service Accounts would make this even better. https://cloud.google.com/compute/docs/access/service-accounts for details on them. Google limits the Google drive uploads to 750GBs a day and 10TBs a day down. Each Service Account has it's own limits that act independently of the main accounts limits. I dedicate a service account to a Team Drive today for rclone and restic(which uses the rclone). This allows me to have dedicated transfer limits for my backups vs it being shared with my main account. |
An update on this - I was able to pull the master and merge rsanger's changes. I have been backing up three different folders and it has been working wonderfully. Only caveat is that gcd://sharedDriveId@backup/: creates a : sub-folder in backup folder. I tried to run it without the : in the URI and it didn't accept it. For now, that's a minor annoyance but I can live with that. I will migrate to the official release when this is pulled in but wanted to provide an update on the real world experience from the change. |
Thanks for the feedback. I think I have found the problem. The drive code won't automatically create a folder in the root of the drive (for all types of drives, both user or shared), but will automatically create subdirectories in all other cases. So with an empty drive (shared or default), where 'my-backup' does not exist is see:
Create 'my-backup' through the Gdrive website. Then I see:
Now that my-backup exists, I can create a backup in any subdirectory whether it exists or not.
I see identical behaviour both with and without a trailing slash. |
Yes. That’s exactly what was happening in my case.
Thanks for confirming.
…On Jan 10, 2020, 6:03 PM -0800, Richard Sanger ***@***.***>, wrote:
> An update on this - I was able to pull the master and merge rsanger's changes. I have been backing up three different folders and it has been working wonderfully.
> Only caveat is that ***@***.***/: creates a : sub-folder in backup folder. I tried to run it without the : in the URI and it didn't accept it.
> For now, that's a minor annoyance but I can live with that. I will migrate to the official release when this is pulled in but wanted to provide an update on the real world experience from the change.
Thanks for the feedback.
I think I have found the problem. The drive code won't automatically create a folder in the root of the drive (for all types of drives, both user or shared), but will automatically create subdirectories in all other cases.
So with an empty drive (shared or default), where 'my-directory' does not exist is see:
$ ./duplicacy_main.exe -d -v init testnoslash ***@***.***
Reading the environment variable DUPLICACY_GCD_TOKEN
Failed to load the Google Drive storage at ***@***.***: Failed to create directory 'my-directory': Parent directory '' does not exist
Create 'my-directory' through the Gdrive website. Then I see:
$ ./duplicacy_main.exe -d -v init testnoslash ***@***.***
Reading the environment variable DUPLICACY_GCD_TOKEN
Reading the environment variable DUPLICACY_GCD_TOKEN
Compression level: 100
Average chunk size: 4194304
Maximum chunk size: 16777216
Minimum chunk size: 1048576
Chunk seed: 6475706c6963616379
Hash key: 6475706c6963616379
ID key: 6475706c6963616379
File chunks are encrypted
Metadata chunks are encrypted
D:\Desktop\DuplicacyShared will be backed up to ***@***.*** with id testnoslash
Now that my-backup exists, I can create a backup in any subdirectory whether it exists or not.
$ rm -r .duplicacy
$ ./duplicacy_main.exe -d -v init testnoslash ***@***.***/folder1/folder2
Reading the environment variable DUPLICACY_GCD_TOKEN
Reading the environment variable DUPLICACY_GCD_TOKEN
Compression level: 100
Average chunk size: 4194304
Maximum chunk size: 16777216
Minimum chunk size: 1048576
Chunk seed: 6475706c6963616379
Hash key: 6475706c6963616379
ID key: 6475706c6963616379
File chunks are encrypted
Metadata chunks are encrypted
D:\Desktop\DuplicacyShared will be backed up to ***@***.***/folder1/folder2 with id testnoslash
I see identical behaviour both with and without a trailing slash.
Can you confirm if this is the behaviour you are seeing?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Ok. Looking at the init docs
It should automatically create this directory, so I will work on a fix. |
init would not create directories in the root of a drive as it did not know the root drive's ID.
Thank you for your contribution. This looks great! |
This pull request has been mentioned on Duplicacy Forum. There might be relevant details there: |
Fixes issue #368
This adds support for shared google drives (previously called team drives) storage.
I'm not sure if this is the best way to specify shared drives, but it works and remains backwards compatible.
A shared drive can be accessed via
gcd://sharedDriveId@path/to/storage
sharedDriveId is optional and if omitted duplicacy stores to the user's drive.
This remains backwards compatible with existing drives. E.g.
gcd://path/to/storage
I have not included any documentation or tests, as docs and tests appear to be maintained outside of this repo.