all repos — s3brm @ 55ba9741b59321ab3765ee4a1c5aee0e26a049d6

S3 Backup Retention Manager

README.md (view raw)

 1# S3BRM - S3 Backup Retention Manager
 2
 3S3BRM is a tool created to manage the retention of files saved on an s3 object storage.
 4It allows in particular to delete files according to a backup plan.
 5
 6## Configuration
 7
 8```shell
 9curl https://raw.githubusercontent.com/5ika/S3BRM/main/env.sh.example > env.sh
10nano env.sh # See example below
11source env.sh # Set variables in the current environnment
12```
13
14Example of configuration for the following backup plan:
15- Keep daily backups of the last 15 days
16- Keep weekly backups of the last month
17- Keep monthly backups for one year
18
19```shell
20# env.sh
21export S3_ENDPOINT_HOST=sos-ch-dk-2.exo.io
22export S3_ACCESS_KEY=ACCESSKEY
23export S3_SECRET_KEY=SECRETKEY
24export S3_REGION=ch-dk-2
25export S3_BUCKET=my-bucket
26export FILES_PREFIX=database/
27export DAILY_BACKUP_INTERVAL=15
28export WEEKLY_BACKUP_INTERVAL=31
29export MONTHLY_BACKUP_INTERVAL=365
30```
31
32## Execution
33
34```shell
35deno run --allow-env --allow-net="$S3_ENDPOINT_HOST" https://raw.githubusercontent.com/5ika/S3BRM/main/mod.ts 
36```
37
38To test the tool behavior without deleting anything, one can use the debug mode with `-d` or `--debug` parameter:
39
40```shell
41deno run --allow-env --allow-net="$S3_ENDPOINT_HOST" https://raw.githubusercontent.com/5ika/S3BRM/main/mod.ts --debug
42```