Skip to content

Python application to maintain a local backup copy of the Google Drive cloud files

License

Notifications You must be signed in to change notification settings

Teidesat/GDrive-Backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GDrive-Backup

Python 3.6 Google Drive API v3 License: GPL v3 Version

From TEIDESAT Project and Hyperspace Canarias

Description

GDrive-Backup is an small python application designed to maintain a local backup copy of the Google Drive cloud files.

Files are downloaded into a local backup folder. Each time the application is re-run the local backup folder gets incrementally updated with changes. Old files, deleted or modified, are moved into a revisions folder. Google Docs, Google Spreadsheets, Google Presentations and other Google files are exported as pdf (files bigger than ~10MB can't be exported using the API, so they are exported using the export url).

The credentials.json file from a Google Cloud Platform project is needed (an empty example is provided in credentials_user.json) which is used to access the API service. Change any options in the configuration file:

{
  "root_folder": "HyperSpace",
  "backup_dir": "../backup",
  "revisions_dir": "../revisions",
  "tree_pickle": "../saves/tree.pickle",
  "token_pickle": "../token/token.pickle",
  "credentials": "../token/credentials_teidesat00.json",
  "scopes": ["https://www.googleapis.com/auth/drive.readonly"]
}

Note that modifying the files when the backup update is taking place may result in multiple file errors.

Task scheduler example command for windows: powershell.exe -windowstyle minimized -c python -u "C:\...\GDrive-Backup\src\run_backup.py" | Tee-Object "../saves/log.txt" -Append

Prerequisites

  • Python modules pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib

Resources

About

Python application to maintain a local backup copy of the Google Drive cloud files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages