Skip to content

codingmatty/backup-cron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postgres S3 backups

A simple NodeJS application to backup your PostgreSQL database to S3 via a cron.

Deploy on Railway


Encryption (Optional)

Reference: https://www.imagescape.com/blog/encrypted-postgres-backups/

  1. Generate a public/private key pair:
openssl req -x509 -nodes -days 1000000 -newkey rsa:4096 -keyout backup_key.pem\
 -subj "/C=US/ST=Illinois/L=Chicago/O=IT/CN=www.example.com" \
 -out backup_key.pem.pub
  1. Add the public key as ENCRYPTION_KEY_PUBLIC environment variable to automatically trigger encryption for each backup.

  2. To decrypt use the following command:

openssl smime -decrypt -in ./backup-$TIMESTAMP.tar.gz.enc -binary -inform DEM -inkey backup_key.pem > ./backup-$TIMESTAMP.tar.gz

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •