-
Notifications
You must be signed in to change notification settings - Fork 8
Using the orchestrator ‐ Doing the housekeeping
Orsiris de Jong edited this page Feb 17, 2025
·
1 revision
NPBackup has been designed to be able to use multiple repositories, which can inherit from group settings.
The following example defines multiple repositories, which inherit retention policies from two different groups.
From there, you can have a single npbackup that will check, apply retention policies and prune the repositories according to their retention policies with:
npbackup-cli -c housekeeping.conf --housekeeping --repo-name __all__
You could also run only retention polciies for the group 14d-retention with
npbackup-cli -c housekeeping.conf --housekeeping --group-name 14d-retention
Example housekeeping configuration file:
conf_version: 3.0
audience: private
repos:
some_repo_name:
repo_uri: /path/to/a/repo
repo_group: 14d-retention
backup_opts: {}
repo_opts:
repo_password: get_a_good_password
is_protected: false
another_repo:
repo_group: 14d-retention
repo_uri: s3:https://some.s3.server.local/bucket
repo_opts:
repo_password: super_secret_password
env:
encrypted_env_variables:
AWS_ACCESS_KEY_ID: myawskey
AWS_SECRET_ACCESS_KEY: myawssecret
a_good_repo:
repo_group: 14d-retention
repo_uri: /path/to/local/repo
repo_opts:
repo_password: password1
is_protected: false
hyervisor_repo:
repo_group: 14d-retention
repo_uri: rest:https://user:[email protected]/repo_path
repo_opts:
repo_password: another_password
is_protected: false
my_secret_repo:
repo_group: 14d-retention
repo_uri: /some/repo/path
repo_opts:
repo_password: a_password
is_protected: false
cube-repo:
repo_group: 3y-retention
repo_uri:
s3:https://myrepo.local/somebucket
repo_opts:
repo_password:
otherpassword
env:
encrypted_env_variables:
AWS_ACCESS_KEY_ID: myotherawskey
AWS_SECRET_ACCESS_KEY: myotherawssecret
is_protected: false
repoX:
repo_group: 3y-retention
repo_uri: /path/to/my/repo
repo_opts:
repo_password: somepassword
is_protected: false
groups:
14d-retention:
repo_opts:
upload_speed: 800.0 Mib
download_speed: 0.0 Kib
backend_connections: 0
retention_policy:
last: 3
hourly: 72
daily: 14
weekly: 4
monthly: 0
yearly: 0
tags: []
keep_within: true
group_by_host: true
group_by_tags: true
group_by_paths: false
ntp_server:
prometheus:
backup_job: ${MACHINE_ID}
group: ${MACHINE_GROUP}
is_protected: false
3y-retention:
repo_opts:
retention_policy:
last: 3
hourly: 72
daily: 30
weekly: 4
monthly: 12
yearly: 3
tags: []
keep_within: true
group_by_host: true
group_by_tags: true
group_by_paths: false
ntp_server:
prometheus:
backup_job: ${MACHINE_ID}
group: ${MACHINE_GROUP}
is_protected: false
identity:
machine_id: ${HOSTNAME}__z3Z0
machine_group:
global_prometheus:
metrics: metrics
instance: ${MACHINE_ID}
destination: https://pushgateway.local/metrics/job/${BACKUP_JOB}
http_username: pushgateway_user
http_password: pushgateway_password
additional_labels:
backup_type: housekeeping
no_cert_verify: false
global_options:
auto_upgrade: false
auto_upgrade_interval: 10
auto_upgrade_server_url:
auto_upgrade_server_username:
auto_upgrade_server_password:
auto_upgrade_host_identity: ${MACHINE_ID}
auto_upgrade_group: ${MACHINE_GROUP}