Skip to content

This repository builds a docker image used to backup databases, zip the backups and then push them to cloud storage for offsite archives

Notifications You must be signed in to change notification settings

jsfillman/db_zip2cloud

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

db_zip2cloud

This is a container for backing up databases such as ArangoDB, compressing the backups and then synchronizing a remote S3 bucket against a local archive of the compressed backups

Operation

  1. [OPTIONAL] Perform a database dump based on environment variables provided, and place it in /dump/
  2. Use 7zip to compress and encrypt the contents of the /dump/ directory and put it in into /zip/
    • The resulting zip will have have "dump/" as the relative root directory
  3. Prune any files in /zip/ that are older than 30 days
  4. Use rclone with an AWS S3 compatible provider to synchronize /zip/ against a remote S3 bucket and directory. Currently configured for Google Cloud Storage in file rclone.conf

This container requires the following secrets to be in /var/run/secrets:

  • encryption_key - Encryption key used by 7zip for encryption of compressed files
  • gcp_backup_creds - Google service credentials JSON secret for use with rclone (see rclone.conf file for service_account_file directive)

The following environment variables need to be passed into the runtime environment

  • BUCKET - The name of the bucket to be used as the destinatio for copying the backups
  • BUCKETPATH - Path with the bucket to deposit the zipped db files

The following volumes need to be mounted into the running container:

  • /dump/ - Directory either containing existing DB dumps or which will be the destination for a DB dump.
  • /zip/ - Directory for writing the compressed/encrypted DB dumps before copying to the S3 remote

About

This repository builds a docker image used to backup databases, zip the backups and then push them to cloud storage for offsite archives

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 87.6%
  • Dockerfile 12.4%