Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/appzic/backup-psql-to-gdrive
A Dockerized solution to backup a PostgreSQL database and upload it to Google Drive.
https://github.com/appzic/backup-psql-to-gdrive
backup docker google-drive kubernetes postgresql
Last synced: about 1 month ago
JSON representation
A Dockerized solution to backup a PostgreSQL database and upload it to Google Drive.
- Host: GitHub
- URL: https://github.com/appzic/backup-psql-to-gdrive
- Owner: appzic
- License: mit
- Created: 2024-11-28T17:08:24.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-01T18:39:38.000Z (about 1 month ago)
- Last Synced: 2024-12-01T19:31:58.481Z (about 1 month ago)
- Topics: backup, docker, google-drive, kubernetes, postgresql
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Backup PostgreSQL to Google Drive
This project provides a Dockerized solution to back up a PostgreSQL database and upload the backup file to Google Drive.
## Prerequisites
- Docker
- Google Cloud Service Account with Google Drive API enabled## Setup
1. Pull the Docker image:
```bash
docker pull appzic/backup-psql-to-gdrive
```2. Set the following environment variables:
- `DB_NAME`: Your PostgreSQL database name
- `DB_USER`: Your PostgreSQL database user
- `DB_PASSWORD`: Your PostgreSQL database password
- `DB_HOST`: Your PostgreSQL database host
- `DB_PORT`: Your PostgreSQL database port (default is 5432)
- `GDRIVE_FOLDER_ID`: Your Google Drive folder ID where the backup will be uploaded
- `GDRIVE_AUTH_KEY`: Path to your Google Drive service account credentials JSON file## Usage
1. Run the Docker container with the environment variables:
```bash
docker run -e DB_NAME=your_db_name \
-e DB_USER=your_db_user \
-e DB_PASSWORD=your_db_password \
-e DB_HOST=your_db_host \
-e DB_PORT=your_db_port \
-e GDRIVE_FOLDER_ID=your_gdrive_folder_id \
-e GDRIVE_AUTH_KEY=/path/to/your/credentials.json \
appzic/backup-psql-to-gdrive
```2. The backup script will run and upload the PostgreSQL database backup to the specified Google Drive folder.
## License
This project is licensed under the MIT License.