diff --git a/cmd/backup/main.go b/cmd/backup/main.go index 1b3e74f..b6a7545 100644 --- a/cmd/backup/main.go +++ b/cmd/backup/main.go @@ -426,7 +426,7 @@ func (s *script) pruneOldBackups() error { ) } - var matches []os.FileInfo + var matches []string for _, candidate := range candidates { fi, err := os.Stat(candidate) if err != nil { @@ -438,14 +438,14 @@ func (s *script) pruneOldBackups() error { } if fi.ModTime().Before(deadline) { - matches = append(matches, fi) + matches = append(matches, candidate) } } if len(matches) != 0 && len(matches) != len(candidates) { var errors []error for _, candidate := range matches { - if err := os.Remove(candidate.Name()); err != nil { + if err := os.Remove(candidate); err != nil { errors = append(errors, err) } } diff --git a/test/compose/docker-compose.yml b/test/compose/docker-compose.yml index 26dbbb9..1646ce6 100644 --- a/test/compose/docker-compose.yml +++ b/test/compose/docker-compose.yml @@ -27,8 +27,8 @@ services: BACKUP_CRON_EXPRESSION: 0 0 5 31 2 ? BACKUP_RETENTION_DAYS: ${BACKUP_RETENTION_DAYS:-7} BACKUP_PRUNING_LEEWAY: 5s + BACKUP_PRUNING_PREFIX: test GPG_PASSPHRASE: 1234secret - # BACKUP_PRUNING_PREFIX: test volumes: - ./local:/archive - app_data:/backup/app_data:ro