all repos — s3brm @ main

S3 Backup Retention Manager

55ba9741
docs: 📝 Add README.md
Tim Izzo tim@octree.ch
Thu, 18 Aug 2022 12:34:01 +0200
c543e4f5
feat: 🎉 Setup basic script
Tim Izzo tim@octree.ch
Thu, 18 Aug 2022 12:16:13 +0200

S3BRM - S3 Backup Retention Manager

S3BRM is a tool created to manage the retention of files saved on an s3 object storage. It allows in particular to delete files according to a backup plan.

Configuration

curl https://raw.githubusercontent.com/5ika/S3BRM/main/env.sh.example > env.sh
nano env.sh # See example below
source env.sh # Set variables in the current environnment

Example of configuration for the following backup plan: - Keep daily backups of the last 15 days - Keep weekly backups of the last month - Keep monthly backups for one year

# env.sh
export S3_ENDPOINT_HOST=sos-ch-dk-2.exo.io
export S3_ACCESS_KEY=ACCESSKEY
export S3_SECRET_KEY=SECRETKEY
export S3_REGION=ch-dk-2
export S3_BUCKET=my-bucket
export FILES_PREFIX=database/
export DAILY_BACKUP_INTERVAL=15
export WEEKLY_BACKUP_INTERVAL=31
export MONTHLY_BACKUP_INTERVAL=365

Execution

deno run --allow-env --allow-net="$S3_ENDPOINT_HOST" https://raw.githubusercontent.com/5ika/S3BRM/main/mod.ts 

To test the tool behavior without deleting anything, one can use the debug mode with -d or --debug parameter:

deno run --allow-env --allow-net="$S3_ENDPOINT_HOST" https://raw.githubusercontent.com/5ika/S3BRM/main/mod.ts --debug
clone
git clone https://git.5ika.ch/s3brm.git