This script backuping postgresql database to Amazon S3.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Pavel Zhuravlev ebac71e2aa Удалить '' 10 months ago update README 10 months ago add new settings and cleanup code 10 months ago

RaZZlom backup script

This script i wrote to backup my Misskey instance database to Amazon S3.

Getting Started

Install boto3 library:

pip install boto3

After installing boto3 set up credentials (in e.g. ~/.aws/credentials):

aws_access_key_id = YOUR_KEY
aws_secret_access_key = YOUR_SECRET

Then, set up a default region (in e.g. ~/.aws/config):


Clone git repository:

git clone

Change default settings:

bucket_name = 'YOUR_BUCKET_NAME'
recipient = 'YOUR_GPG_KEY'
hash_type = 'sha512'  # md5 or sha512
logs_path = './logs/'

Then execute script with cron or systemd.timer every hour.

What script do:

  • Make postgres database dump
  • Encrypt dump with GPG key
  • Create md5 or sha512 checksum file
  • Upload encrypted file and checksum file to s3
  • Delete dump, encrypted file and checksum file from disk

To delete old backups from s3 you need to configure bucket Lifecycle rules.

Contact Me

Fediverse -
Mail -