Skip to content

Restic: restic / prune doesn't consider hostname #247

@DerRockWolf

Description

@DerRockWolf

The readme currently states the following:

When using restic, at least one of HOSTNAME or BACKUP_NAME must be unique, when sharing a repository.
Otherwise other instances using the same repository might prune your backups prematurely.

But the restic forget call currently doesn't consider the hostname, as the --host parameter is missing:

command restic --retry-lock "${RESTIC_RETRY_LOCK}" forget --tag "${restic_tags_filter}" ${PRUNE_RESTIC_RETENTION} "${@}"

So if you have multiple different servers that are backed up into one restic repository, the mc-backup container of the first server could delete snapshots of the second server if the BACKUP_NAME isn't unique.

I've noticed this because your minecraft helm chart uses the worldSaveName as the BACKUP_NAME, which default to world and, at least in my case, was unchanged.

Depending on how we interpret it this can be solved in two ways:

  • Correct the readme to explicitly state that BACKUP_NAME must be unique
  • Change the restic forget call to include --host "${RESTIC_HOSTNAME}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions