<div align="center" markdown="1">
[]()
# Drive Backup
### A simple way to backup your Google Drive locally.
[](https://pypi.org/project/drive-backup/)
[](https://github.com/dunkmann00/Drive-Backup-Credentials/releases/latest)
[](https://pypi.org/project/drive-backup/)
[](https://github.com/dunkmann00/Drive-Backup/actions/workflows/build.yml)
[](https://github.com/dunkmann00/Drive-Backup/actions/workflows/github_pages.yml)
[](LICENSE.md)
</div>
## Introduction
If you need to backup your Google Drive this is exactly the tool for you. It
will fetch the files and folders you want to backup from your Google Drive and
store them locally.
<!-- asciinema-start -->
[](https://asciinema.org/a/656228)
<!-- asciinema-end -->
## Notable Features
- Supports backing up either your entire Google Drive or a specific directory.
- **Efficient**, Drive Backup will first check if a file it wants to download
was already downloaded in a previous backup.
- Works through Google Drive API which uses OAuth 2.0 and sends all data
securely over HTTPS.
- Supports both Mac, Windows, & Linux.
- Emits a notification when complete or when there is a problem (Mac & Windows
only).
- Choose between 3 backup types:
- **complete**
- Creates a new backup, leaving previous backup untouched.
- **increment**
- Creates a new backup, moving files that have not changed since the
previous backup into the new backup, and leaving only old files remaining
in the previous backup.
- **update**
- Update the previous backup in-place with the latest changes from your
Google Drive.
- Convert Google Document files (Docs, Sheets, Slides) into their corresponding
MS Office type or to PDF.
- Supports shortcuts in your Google Drive. It will treat a shortcut like a
separate file each time it encounters one.
- Creates a log file with every backup so you can verify all your files were
downloaded or check for errors to get information why something went wrong or
didn't download.
- Saves the configuration for each backup in a `bkp` file so you can easily run
the same backup multiple times.
## Installation
Drive Backup requires Python version 3.11 or higher.
There are a few different ways to install Drive Backup. Depending on your
setup/need a different approach is recommended.
### Via `pipx`
If `pipx` is installed, it is the recommended way of installing Drive Backup.
```bash
pipx install drive-backup
```
### Via Prebuilt Binaries
The prebuilt binaries are the next easiest way to get up and running. A unique
benefit of the prebuilt binaries is the ability to place them wherever you like.
If you are storing your files on an external drive, it may be covenient to also
store the binaries there. That way, you could connect the external drive to any
computer (...that you trust of course) and be able to easily backup from it.
**Download the prebuilt binaries from the
[latest release](https://github.com/dunkmann00/Drive-Backup-Credentials/releases/latest).**
### Via `git clone`
After cloning the repo make sure to install the project with poetry
(`poetry install`). If you don't have poetry installed on your system you can
find info on how to install it on their
[docs](https://python-poetry.org/docs/#installation). From this point it is like
any other poetry project:
```bash
poetry run dbackup ...
```
## Usage
The first time Drive Backup is ran (or whenever there is no valid user signed
in), a browser window will open asking you to sign in to Google and to give
Drive Backup permission to download files from Google Drive.
> [!IMPORTANT]
> When Drive Backup requests your permission to access your Google
Drive Files, you will see a warning screen informing you "**Google hasn’t
verified this app**". This doesn't mean the app is actually dangerous, just
that it is not verified. This is currently unavoidable unfortunately. For more
info on why this is happening see the [App Verification](#app-verification)
section below.
Below are some common examples to show how Drive Backup works. To see more info
about all of the options and commands run `dbackup -h` or `dbackup [command] -h`
.
Backup your entire Google Drive into the current directory. Drive Backup will
make a directory in your current directory titled `Google Drive Backup {date}`
where `date` is the current date.
```bash
dbackup backup
```
Backup your entire Google Drive into a specific directory titled `my-backups`:
```bash
dbackup backup -d my-backups
```
Backup only the directory on Google Drive called `Vacation Photos` into
`my-backups` and run an `update` type backup.
```bash
dbackup backup -d my-backups -t update --source "Vacation Photos"
```
If you wanted to rerun a previous backup, you can pass in the backup config file
from that backup and all the same settings will be used. By default the
`drive-backup.bkp` file from a backup is stored in the destination directory.
As an example, lets say more photos were added to our `Vacation Photos`
directory on Google Drive and we want to back them up. We don't need to use the
`-t` or `--source` options again, just `-c`.
```bash
dbackup backup -c my-backups/drive-backup.bkp
```
When downloading many files, the log can get cluttered with both Drive Backup's
logging of file info and the underlying Google library's logging of download
info. For this reason it may be desirable to only log messages from Drive
Backup and filter out the rest.
```bash
dbackup backup --log-filter
```
Similarly, you may only want to record logs of files that need to be downloaded,
not files that are already present (or in other words, not files that were
downloaded on a previous backup).
```bash
dbackup backup --log-changes
```
You can sign out of your account so you can sign into a different Google
account.
```bash
dbackup user sign-out
```
You can also check which user is currently logged in.
```bash
dbackup user info
```
### App Verification
Drive Backup needs your permission to access your Google Drive files and
folders. To do this, Drive Backup identifies itself to Google with an
application client credential. You are then shown a webpage from Google, asking
for your permission to allow Drive Backup the access it is requesting.
Due to how Google has recently decided to handle verifying client apps, it was
not possible for me to have Drive Backup verified. It would cost $500+ each year
to be verified. Unfortunately, I am not willing/in a position to pay them that
amount of money to verify a free app.
The good news here is that Drive Backup will still function as it should even
though it is not verified. However, when you are prompted to give the app
permission to access your Google Drive, you will be met with a scary window that
contains the following:

I can tell you that this app is not dangerous and will not do anything nefarious
with your Google Drive data or any data on your computer. It also [doesn't
collect any info from you](Privacy.md). But, since all the source code is open
source and
[availble for you to check out](https://github.com/dunkmann00/Drive-Backup),
you don't have to take my word for that.
To proceed through the permission request process and allow Drive Backup access
to Google Drive, click on **"Advanced"** and then **"Go to Drive Backup
(unsafe)"**. This will bring you to the page where you can allow Drive Backup to
have access.
I do hope none of this deters you from using Drive Backup, as it is a very
useful tool that I use myself. If you don't want to use the built in app
credential that ships with the app, you can look into
[generating your own client credential](#custom-client-credentials) and use that
instead. With this you can be even more certain Drive Backup only has the
permissions it needs (i.e. Google Drive Read access).
### Custom Client Credentials
If you are having problems with Drive Backup and are hitting download limits,
you can supply your own client credentials. To generate your own, check out the
[Authorize credentials for a desktop application](https://developers.google.com/drive/api/quickstart/python#authorize_credentials_for_a_desktop_application)
section on the Google Drive Python API Guide page. Once you have followed the
steps and downloaded the json file, pass it into Drive Backup with the
`--client-credentials` flag when you run a backup. Now Drive Backup will use
your client credentials instead of the default one that ships with the app. Note
that this will get stored in the backup config `bkp` file, so if you are
repeating a backup with `--backup-config` you don't need to explicitly pass the
custom client credential each time.
```bash
dbackup backup --client-credentials path/to/your/personal/credentials.json
```
## Privacy Policy
Check out Drive Backup's [Privacy Policy](Privacy.md).
## Copyright and License
Google Drive is a trademark of Google Inc. Use of this trademark is subject to
Google Permissions.
2024 George Waters under the MIT License. See [LICENSE](LICENSE.md) for details.
Raw data
{
"_id": null,
"home_page": "https://www.georgeh2os.com/Drive-Backup/",
"name": "drive-backup",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.13,>=3.11",
"maintainer_email": null,
"keywords": "Google Drive, backup",
"author": "George Waters",
"author_email": "gwatersdev@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/2c/1d/8103d8481d019d5b1cd6d29687894958a53d92a3b03bf603a933def7f862/drive_backup-2.0.0.tar.gz",
"platform": null,
"description": "<div align=\"center\" markdown=\"1\">\n\n[]()\n\n# Drive Backup\n\n### A simple way to backup your Google Drive locally.\n\n[](https://pypi.org/project/drive-backup/)\n[](https://github.com/dunkmann00/Drive-Backup-Credentials/releases/latest)\n[](https://pypi.org/project/drive-backup/)\n[](https://github.com/dunkmann00/Drive-Backup/actions/workflows/build.yml)\n[](https://github.com/dunkmann00/Drive-Backup/actions/workflows/github_pages.yml)\n[](LICENSE.md)\n\n</div>\n\n## Introduction\n\nIf you need to backup your Google Drive this is exactly the tool for you. It\nwill fetch the files and folders you want to backup from your Google Drive and\nstore them locally.\n\n<!-- asciinema-start -->\n[](https://asciinema.org/a/656228)\n<!-- asciinema-end -->\n\n## Notable Features\n\n- Supports backing up either your entire Google Drive or a specific directory.\n- **Efficient**, Drive Backup will first check if a file it wants to download\n was already downloaded in a previous backup.\n- Works through Google Drive API which uses OAuth 2.0 and sends all data\n securely over HTTPS.\n- Supports both Mac, Windows, & Linux.\n- Emits a notification when complete or when there is a problem (Mac & Windows\n only).\n- Choose between 3 backup types:\n - **complete**\n - Creates a new backup, leaving previous backup untouched.\n - **increment**\n - Creates a new backup, moving files that have not changed since the\n previous backup into the new backup, and leaving only old files remaining\n in the previous backup.\n - **update**\n - Update the previous backup in-place with the latest changes from your\n Google Drive.\n- Convert Google Document files (Docs, Sheets, Slides) into their corresponding\n MS Office type or to PDF.\n- Supports shortcuts in your Google Drive. It will treat a shortcut like a\n separate file each time it encounters one.\n- Creates a log file with every backup so you can verify all your files were\n downloaded or check for errors to get information why something went wrong or\n didn't download.\n- Saves the configuration for each backup in a `bkp` file so you can easily run\n the same backup multiple times.\n\n## Installation\n\nDrive Backup requires Python version 3.11 or higher.\n\nThere are a few different ways to install Drive Backup. Depending on your\nsetup/need a different approach is recommended.\n\n### Via `pipx`\n\nIf `pipx` is installed, it is the recommended way of installing Drive Backup.\n\n```bash\npipx install drive-backup\n```\n\n### Via Prebuilt Binaries\n\nThe prebuilt binaries are the next easiest way to get up and running. A unique\nbenefit of the prebuilt binaries is the ability to place them wherever you like.\nIf you are storing your files on an external drive, it may be covenient to also\nstore the binaries there. That way, you could connect the external drive to any\ncomputer (...that you trust of course) and be able to easily backup from it.\n\n**Download the prebuilt binaries from the\n[latest release](https://github.com/dunkmann00/Drive-Backup-Credentials/releases/latest).**\n\n### Via `git clone`\n\nAfter cloning the repo make sure to install the project with poetry\n(`poetry install`). If you don't have poetry installed on your system you can\nfind info on how to install it on their\n[docs](https://python-poetry.org/docs/#installation). From this point it is like\nany other poetry project:\n\n```bash\npoetry run dbackup ...\n```\n\n## Usage\n\nThe first time Drive Backup is ran (or whenever there is no valid user signed\nin), a browser window will open asking you to sign in to Google and to give\nDrive Backup permission to download files from Google Drive.\n\n> [!IMPORTANT]\n> When Drive Backup requests your permission to access your Google\n Drive Files, you will see a warning screen informing you \"**Google hasn\u2019t\n verified this app**\". This doesn't mean the app is actually dangerous, just\n that it is not verified. This is currently unavoidable unfortunately. For more\n info on why this is happening see the [App Verification](#app-verification)\n section below.\n\nBelow are some common examples to show how Drive Backup works. To see more info\nabout all of the options and commands run `dbackup -h` or `dbackup [command] -h`\n.\n\nBackup your entire Google Drive into the current directory. Drive Backup will\nmake a directory in your current directory titled `Google Drive Backup {date}`\nwhere `date` is the current date.\n```bash\ndbackup backup\n```\n\nBackup your entire Google Drive into a specific directory titled `my-backups`:\n```bash\ndbackup backup -d my-backups\n```\n\nBackup only the directory on Google Drive called `Vacation Photos` into\n`my-backups` and run an `update` type backup.\n```bash\ndbackup backup -d my-backups -t update --source \"Vacation Photos\"\n```\n\nIf you wanted to rerun a previous backup, you can pass in the backup config file\nfrom that backup and all the same settings will be used. By default the\n`drive-backup.bkp` file from a backup is stored in the destination directory.\n\nAs an example, lets say more photos were added to our `Vacation Photos`\ndirectory on Google Drive and we want to back them up. We don't need to use the\n`-t` or `--source` options again, just `-c`.\n```bash\ndbackup backup -c my-backups/drive-backup.bkp\n```\n\nWhen downloading many files, the log can get cluttered with both Drive Backup's\nlogging of file info and the underlying Google library's logging of download\ninfo. For this reason it may be desirable to only log messages from Drive\nBackup and filter out the rest.\n```bash\ndbackup backup --log-filter\n```\n\nSimilarly, you may only want to record logs of files that need to be downloaded,\nnot files that are already present (or in other words, not files that were\ndownloaded on a previous backup).\n```bash\ndbackup backup --log-changes\n```\n\nYou can sign out of your account so you can sign into a different Google\naccount.\n```bash\ndbackup user sign-out\n```\n\nYou can also check which user is currently logged in.\n```bash\ndbackup user info\n```\n\n### App Verification\n\nDrive Backup needs your permission to access your Google Drive files and\nfolders. To do this, Drive Backup identifies itself to Google with an\napplication client credential. You are then shown a webpage from Google, asking\nfor your permission to allow Drive Backup the access it is requesting.\n\nDue to how Google has recently decided to handle verifying client apps, it was\nnot possible for me to have Drive Backup verified. It would cost $500+ each year\nto be verified. Unfortunately, I am not willing/in a position to pay them that\namount of money to verify a free app.\n\nThe good news here is that Drive Backup will still function as it should even\nthough it is not verified. However, when you are prompted to give the app\npermission to access your Google Drive, you will be met with a scary window that\ncontains the following:\n\n\n\nI can tell you that this app is not dangerous and will not do anything nefarious\nwith your Google Drive data or any data on your computer. It also [doesn't\ncollect any info from you](Privacy.md). But, since all the source code is open\nsource and\n[availble for you to check out](https://github.com/dunkmann00/Drive-Backup),\nyou don't have to take my word for that.\n\nTo proceed through the permission request process and allow Drive Backup access\nto Google Drive, click on **\"Advanced\"** and then **\"Go to Drive Backup\n(unsafe)\"**. This will bring you to the page where you can allow Drive Backup to\nhave access.\n\nI do hope none of this deters you from using Drive Backup, as it is a very\nuseful tool that I use myself. If you don't want to use the built in app\ncredential that ships with the app, you can look into\n[generating your own client credential](#custom-client-credentials) and use that\ninstead. With this you can be even more certain Drive Backup only has the\npermissions it needs (i.e. Google Drive Read access).\n\n### Custom Client Credentials\n\nIf you are having problems with Drive Backup and are hitting download limits,\nyou can supply your own client credentials. To generate your own, check out the\n[Authorize credentials for a desktop application](https://developers.google.com/drive/api/quickstart/python#authorize_credentials_for_a_desktop_application)\nsection on the Google Drive Python API Guide page. Once you have followed the\nsteps and downloaded the json file, pass it into Drive Backup with the\n`--client-credentials` flag when you run a backup. Now Drive Backup will use\nyour client credentials instead of the default one that ships with the app. Note\nthat this will get stored in the backup config `bkp` file, so if you are\nrepeating a backup with `--backup-config` you don't need to explicitly pass the\ncustom client credential each time.\n\n```bash\ndbackup backup --client-credentials path/to/your/personal/credentials.json\n```\n\n## Privacy Policy\n\nCheck out Drive Backup's [Privacy Policy](Privacy.md).\n\n## Copyright and License\n\nGoogle Drive is a trademark of Google Inc. Use of this trademark is subject to\nGoogle Permissions.\n\n2024 George Waters under the MIT License. See [LICENSE](LICENSE.md) for details.\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Backup your Google Drive files locally.",
"version": "2.0.0",
"project_urls": {
"Homepage": "https://www.georgeh2os.com/Drive-Backup/",
"Issues": "https://github.com/dunkmann00/Drive-Backup/issues",
"Repository": "https://github.com/dunkmann00/Drive-Backup"
},
"split_keywords": [
"google drive",
" backup"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c88c6d920c7398555ae790728acd81523caff7aa11a3142e9dd82de60497bc21",
"md5": "602aa252ea06a3264e136eb29d545dca",
"sha256": "03f47e941e30d9edd040bac4e42ef36bf73431eb27bffcf9e27856305215778e"
},
"downloads": -1,
"filename": "drive_backup-2.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "602aa252ea06a3264e136eb29d545dca",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.13,>=3.11",
"size": 1183751,
"upload_time": "2024-09-27T21:09:54",
"upload_time_iso_8601": "2024-09-27T21:09:54.202701Z",
"url": "https://files.pythonhosted.org/packages/c8/8c/6d920c7398555ae790728acd81523caff7aa11a3142e9dd82de60497bc21/drive_backup-2.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2c1d8103d8481d019d5b1cd6d29687894958a53d92a3b03bf603a933def7f862",
"md5": "505637633c365d95d4c75af09bf214bb",
"sha256": "08acf981869dfe0930bbaebebc6085e2a427874714c5840ce651ad57659423bd"
},
"downloads": -1,
"filename": "drive_backup-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "505637633c365d95d4c75af09bf214bb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.13,>=3.11",
"size": 1181522,
"upload_time": "2024-09-27T21:09:57",
"upload_time_iso_8601": "2024-09-27T21:09:57.361362Z",
"url": "https://files.pythonhosted.org/packages/2c/1d/8103d8481d019d5b1cd6d29687894958a53d92a3b03bf603a933def7f862/drive_backup-2.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-27 21:09:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dunkmann00",
"github_project": "Drive-Backup",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "drive-backup"
}