#backup #s3 #aws #amazon #data-stream #cli #stdin

app s3sb

Store data streams on S3 keeping a number of lates backups

2 releases

0.1.1 Mar 25, 2022
0.1.0 Mar 25, 2022

#81 in #data-stream

32 downloads per month

GPL-3.0-or-later

30KB
188 lines

Latest Version License

S3 Stream Backup

Store data streams on S3 keeping a number of lates backups.

Features:

  • Backup standard input data to timestamped S3 objects.
  • Keep constant number of backups.
  • List and restore backups to standard output.

Example usage

Note: You need to set up AWS credentials and default region using ~/.aws/credentials and ~/.aws/config files or use enviornment variables (AWS_DEFAULT_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) or use instance profile (on EC2). Consulte AWS documentation for details. Additionally options --aws-region and --aws-region-endpoint can be specifed on the command line.

# backup PostgreSQL to S3
su - postgres -c pg_dumpall | xz | s3sb -v mybucket backups/postgress make 2 xz

# restore from S3 backup
s3sb -v mybucket backups/postgress restore | xz -d | su - postgres -c psql

Dependencies

~22–35MB
~509K SLoC