3
0
mirror of https://kolaente.dev/konrad/docker-db-backup.git synced 2026-01-10 02:50:08 +01:00

feat: add backup compression

This commit is contained in:
kolaente
2024-02-13 16:45:10 +01:00
parent 49510a6179
commit 5acf40d86e
7 changed files with 54 additions and 9 deletions

View File

@@ -18,6 +18,7 @@ type conf struct {
Schedule string
MaxBackups int
CompletionWebhookURL string
CompressBackups bool
}
var (
@@ -30,6 +31,7 @@ const (
envSchedule = `BACKUP_SCHEDULE`
envMax = `BACKUP_MAX`
envCompletionWebhookURL = `BACKUP_COMPLETION_WEBHOOK_URL`
envCompressBackups = `BACKUP_COMPRESS`
)
func init() {
@@ -66,6 +68,11 @@ func init() {
if has {
config.CompletionWebhookURL = webhookURL
}
compress, has := os.LookupEnv(envCompressBackups)
if has {
config.CompressBackups = compress == "1" || compress == "true"
}
}
func updateFullBackupPath() {