Skip to content

Beginner question: Sync to personal Google drive #1153

@lxs602

Description

@lxs602

Hi,

This may be a beginner "I can not figure out how to use this" type question.

What steps am I missing?

Your documentation is comprehensive, but a walkthrough guide and signposts would be welcome for less able users.

Would you be interested if I wrote one / otherwise made a contribution to the README? (once I get this working)

================================================================

Pre-existing:

  • A personal google drive account

Steps followed:

  1. Created a new service-account on Google cloud console ("serviceaccount1")
  2. Created personal key for the service account, and downloaded the json (code-obfuscated-XXXXXX-XX-XXXXXXXXXXXX.json)
  3. Enabled Google Drive API for the service account
  4. At the web page interface, shared a folder with the service account, and gave it editor access
  5. Created new folder in local home directory ("~/google-drive-shared")
  6. Initialized the folder:
    ~/go/bin/drive init --service-account-file ~/code-obfuscated-XXXXXX-XX-XXXXXXXXXXXX.json -id YYYYYYYYYYYYYYYYYYYYYYYYYYY ~/google-drive-shared
  7. Relocated to the new folder, and pulled from Google drive:
    $ ~/go/bin/drive pull -id 1t8hARpY7gLPVmHQFxMnG-mmkb7vVxkvu
  8. Made a new file, and tried resyncing to Google Drive:
    ~/go/bin/drive push --no-clobber

Expected behaviour:

  • Only the new file would be uploaded

Actual behaviour:

  • Drive uploads everything to the root folder of the service account. The shared folder on Google Drive is not re-uploaded to.

Resolving...

  • /Documents
  • /Documents/file.png
    ...
  • /Data-documents/FILE.md
  • /Data-documents/README.md
    Addition count 1816 src: 1.49GB
    Proceed with the changes? [Y/n]:

~/google-drive-shared$~/go/bin/drive stat -id YYYYYYYYYYYYYYYYYYYYYYYYYYY

YYYYYYYYYYYYYYYYYYYYYYYYYYY
Filename Documents
FileId YYYYYYYYYYYYYYYYYYYYYYYYYYY
Bytes 0
Size 0.00B
QuotaBytesUsed 0
DirType folder
VersionNumber 16
MimeType application/vnd.google-apps.folder
Etag "abcdefghijklmnopqrstuvwxyz"
ModTime 2025-06-07 15:19:41 +0000 UTC
LastViewedByMe 0001-01-01 00:00:00 +0000 UTC
Shared true
Owners username
LastModifyingUsername username
OriginalFilename
Starred false
Viewed false
Trashed false
ViewersCanDownload false

Name: username [email protected]
Role owner
AccountType user
*

Name: serviceaccount1@code-obfuscated-XXXXXX-XX-XXXXXXXXXXXX serviceaccount1@code-obfuscated-XXXXXX-XX-XXXXXXXXXXXX
Role writer
AccountType user
*

~/google-drive-shared$ ~/go/bin/drive list -id YYYYYYYYYYYYYYYYYYYYYYYYYYY
YYYYYYYYYYYYYYYYYYYYYYYYYYY/Documents/FILE.md
YYYYYYYYYYYYYYYYYYYYYYYYYYY/Documents/file1.png
...

~/google-drive-shared$ ~/go/bin/drive list -depth 1
... No output ...

The wiki page here (https://github.com/odeke-em/drive/wiki/FAQ) suggests:

Image

~/go/bin/drive drive init ~/google-drive
but this only returns the help menu:
Usage: /home/luke/go/bin/drive

where is one of:
about print out information about your Google drive
clashes fix clashes by renaming or trashing all files
...etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions