Skip to content

Drive-sync feature #3

Description

@khnumdev

I need to include support for pushing / downloading a local-db version to/from google drive
Requirements:

  • The script must expose two commands: push and pull.
  • As part of config, we need to put a setting where local-db binary is. It can be provided as setting or as a var when invoking the command.
  • At the moment only Google Drive should be supported, but we can leave it open for the future (ex: OneDrive).
    • I think pydrive2 can be used for google drive; ensure invoke whatever is required to authenticate against your account

Behavior:

  • push [VERSION] [-o]:

    • Run ./local-db stash VERSION.
    • If VERSION is omitted, use today’s date in format YYYY-mm-DD.
    • The stash produces a binary file named local-db-VERSION.bin.
    • Upload that file to Google Drive inside the /datastore folder.
    • If -o is passed, overwrite any existing file with the same name.
  • pull [VERSION]:

    • If VERSION is omitted, download the latest backup from /datastore.
    • If VERSION is provided, download that specific file (local-db-VERSION.bin).
    • Save it locally and run ./local-db restore VERSION.

Other requirements:

  • Fail fast if commands or files are missing.
  • Script must be auditable, modular, and portable.
  • Keep comments minimal, only if strictly necessary.
  • It should be another command, following same format as the ones we have.
  • As usual, add tests to cover as possible and ensure code is being compiled and executed without issues.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions