Skip to content

fiddleplum/google-drive-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

google-drive-backup

A one-way backup of local folders onto your Google Drive

Installation

  1. Copy/clone this repository into a folder on your device.
  2. If you don't have Python 3, download and install it (https://www.python.org/downloads/)
  3. Setup the Python modules:
  • On Mac
    1. pip install --upgrade pip
    2. pip install --upgrade google-api-python-client
  • On Windows:
    1. reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Path /t REG_SZ /d "%path%;c:\python2.7"
    2. python -m pip install --upgrade pip
    3. python -m pip install --upgrade google-api-python-client
  1. Setup the Google Drive API
  2. Go to https://console.developers.google.com
  3. Create a new project and give it a name.
  4. Use Google APIs -> Drive API -> Enable API
  5. Credentials -> New Credentials -> OAuth Client ID -> Configure Consent Screen
  6. Fill out the form -> Other -> Save the client secret for later
  7. On the far right, download to client_secret.json in your google-drive-backup folder.
  8. python backup.py <local folder> <drive folder>
  9. A browser window will open asking for your client secret that you saved from before. Enter it.
  10. You're done!

Syntax

python backup.py -l <local folder> -d <drive folder> [--delete-only]

  • <local folder> The folder path that you would like backed up. It can be absolute or relative to the google-drive-backup folder.
  • <drive folder> The folder path on your Google Drive that you want to store your backed up folder. If it doesn't exist, it will be created. It uses forward slashes as the folder separator.
  • [no-increase] If the phrase "no-increase" is used, there will be no new folders or files created, and only files that are a smaller size than the drive version will be uploaded. This is useful for when you need to run delete before adding more files becuase of the Google Drive size limit.

About

A one-way backup of local folders onto your Google Drive

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages