Skip to contents

Delete snapshot partitions by count or age. At least one of keep_n or max_age_days must be provided.

Usage

brreg_cleanup(
  keep_n = NULL,
  max_age_days = NULL,
  type = c("enheter", "underenheter", "roller")
)

Arguments

keep_n

Integer. Keep the keep_n most recent snapshots and delete the rest. NULL to skip this criterion.

max_age_days

Integer. Delete snapshots older than this many days. NULL to skip this criterion.

type

One of "enheter" or "underenheter".

Value

A tibble of deleted snapshots (invisibly).

See also

brreg_snapshots() to list available snapshots, brreg_data_dir() for storage location.

Other tidybrreg snapshot functions: brreg_data_dir(), brreg_import(), brreg_manifest(), brreg_open(), brreg_snapshot(), brreg_snapshots()

Examples

if (FALSE) {
brreg_cleanup(keep_n = 12)
brreg_cleanup(max_age_days = 365)
}