Skip to content

A tool that backs up chosen files to Google Drive and can be set to run automatically

Notifications You must be signed in to change notification settings

doratako/Google-Drive-Backup

Repository files navigation

Google Drive Backup

Introduction

This solution facilitates the backup of chosen files to Google Drive. The tool operates within a console-based environment, providing the user with a straightforward way to interact with it. The authentication method to interact with Google Drive API is service account

Functionality

Local Folder Selection: The tool initiates by prompting the user to designate a local folder. This folder will be the source for files intended for backup.

Backup Options: User is presented with two distinct backup choices:

  1. Full Folder Backup:The option is provided to create a backup of the entire designated folder. In this mode, any newly created files within the source folder will be automatically backed up during subsequent tool runs. Files that have already been backed up will also be updated.
  2. Selective File Backup: Alternatively, the user can select specific files for backup. Irrespective of newly created files in the source folder, only the chosen files will be considered. The tool will update the content of these selected files in subsequent runs.

Google Drive Destination: Upon selecting the backup mode, the user can opt for the backup destination within their Google Drive.
Alternatively, the user can browse and choose from a list of all folders, including parent and child folders (if the folders are shared with the service account).

Backup Process: Ensuring exception handling to address potential errors during interactions with the Google Drive API or due to incorrect user inputs.

Use

  • Create your Google Drive API https://cloud.google.com/apis/docs/getting-started
  • Create Service Account to authenticate and save your key as 'service_account_key.json'
  • Choose either parent or child folder(s) where you want to back up your local files. Generally, you will need to share the folder(s) with the email address associated with the service account and grant it editing access.
  • Create a virtual environment and install Goolge API Python client library
  • Put the python scripts into the same folder as your 'service_account_key.json' is. Run create_config.py and follow the instructions in the terminal, this will eventually generate a 'config.json' file. Execute backup.py to manage uploads and updates based on the configuration file.
  • Use Task Scheduler or cron jobs to run backup.py at a specific times or intervals

About

A tool that backs up chosen files to Google Drive and can be set to run automatically

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages