Skip to main content

Overview

backmon's binary must run either on a bare-metal host or inside a Docker container. It then can be configured through a configuration file. In it, you specify which disks, local filesystem paths or S3 buckets, have to be monitored.

backmon inspects each of the configured disks. If a backup definition is found in a disk, its backup definition is applied.

backmon tries to locate the configuration file config.yaml in the following directories, priority in the defined order:

  • local directory: ./config.yaml
  • ${HOME}/.backmon/config.yaml
  • /etc/backmon/config.yaml

In the configuration file, you can use environment placeholders like __${VAR}__. Those placeholders will be replaced during the startup of backmon with the corresponding environment variables. You have to place the configuration file at /etc/backmon/config-raw.yaml.

Multiple placeholders in a single element are also supported, e. g.

endpoint: "__${S3_ENDPOINT_HOST}__:__${S3_ENDPOINT_PORT}__"

Command line options for backmon​

OptionDefaultDescription
--debugfalse (bool)Enable debug output; overwrites any log setting from config.yaml

Sample configuration file​


port: 8080
# for update_interval use `time.ParseDuration` format from https://pkg.go.dev/time#example-ParseDuration
# e.g. 1m, 1h, 86400s etc
update_interval: 1m
downloads:
enabled: true

http:
basic_auth:
username: my_username
password: my_password
tls:
certificate: server.rsa.crt
key: server.rsa.key
strict: true

environments:
env_1:
path: /my/backups
disks:
include:
- my-bucket-1
exclude:
- my-secret-bucket-2
- "/regular_ex.*ssions_are_supported/"
all_others: exclude
env_2:
s3:
access_key_id: my_access_key_id
secret_access_key: my_secret_access_key
auto_discover_disks: true
disks:
include:
- my-bucket-1
exclude:
- my-secret-bucket-2
- "/regular_ex.*ssions_are_supported/"
all_others: exclude

Available configuration keys​

KeyDefaultRequiredDescription
port80 (int)NoDefault HTTP port to listen for requests. TLS is not supported at the moment. Consider using a proxy if you need encryption.
update_interval1h (duration)NoChecks each disk in that duration interval. time.ParseDuration format must be used.
log_level<empty> (one of debug, info)NoUsed log level; will be overwritten if --debug is used.
downloads.enabledfalseNoIf true, the latest artifact of a monitored backup disk can be downloaded. This is disabled by default for security reasons (#1).
http.basic_auth.username<empty> (string)NoUsername for HTTP Basic Authentication. If this is set, http.basic_auth.password must be also set.
http.basic_auth.password<empty> (string)NoPassword for HTTP Basic Authentication. If this is set, http.basic_auth.username must be also set.
http.tls.certificate<empty> (string)NoPath to certificate file. If this is set, http.tls.key must be also set.
http.tls.key<empty> (string)NoPath to private key file. If this is set, http.tls.certificate must be also set.
http.tls.strictfalse (bool)NoIf set to true, a preferred TLS default configuration is used.
environments<empty> (list of environment)NoEach environment to check.
environments[]<empty> (string)YesName of environment.
environments[$env].definitionsbackup_definitions.yaml (string)NoYAML file containing the backup definitions.
environments[$env].path<empty> (string)NoLocal path to check for. If you use the path parameter, other parameters specific for S3 are ignored.
environments[$env].s3.regioneu-central-1 (string)NoAWS region
environments[$env].s3.access_key_id<empty> (string)YesAWS Access Key
environments[$env].s3.secret_access_key<empty> (string)YesAWS Secret Access Key
environments[$env].s3.endpoint<empty> (string)NoCustom AWS S3 endpoint. This must be used for Minio buckets or if you are using a local S3 instance.
environments[$env].s3.force_path_stylefalse (bool)NoUse path-style for that S3 bucket. This is deprecated by AWS S3 and should be probably false.
environments[$env].s3.insecurefalse (bool)NoWhether to use HTTP or HTTPS to access the S3 endpoint. This is intended primarily for accessing a local S3 endpoint like MinIO.
environments[$env].s3.tls_skip_verifyfalse (bool)NoWhether to verify the X.509 certificated presented by the S3 endpoint. This is intended primarily for accessing a local S3 endpoint which uses a self signed certificate
environments[$env].s3.token<empty> (string)NoAWS STS session token. You can leave that empty.
environments[$env].s3.auto_discover_diskstrue (bool)NoAutomatically iterate over each S3 bucket.
environments[$env].disks.include<empty> (list of strings)NoOnly include the disks with the given name; case-sensitive; regular expressions are supported.
environments[$env].disks.exclude<empty> (list of strings)NoOnly include the disks with the given name; case-sensitive; regular expressions are supported.
environments[$env].disks.all_othersinclude (one of include, exclude)NoBehaviour for disks which are not explicitly included or excluded.

disks​

The disks section allows you to include or exclude disks which have been found during the discovery phase.

  • A disk is included if it is defined in disks.include or one of those regular expressions matches
  • A disk is excluded if it is defined in disks.exclude or one of those regular expressions matches
  • If a disk is defined in disks.include and disks.exclude, the behaviour of disks.all_others is applied (include by default)
  • If a disk is not explicitly defined in disks.include or disks.exclude, the behaviour of disks.all_others is applied (include by default)
  • If a disk contains a .backmonignore marker file of the root of the disk, the disk is excluded - no matter of any disks.* configurations.

To use a regular expression in disks.include or disks.exclude, you have to put a slash (/) before and after the regular expression:

disks:
include:
- "/(\d{8})\-etcd/"
exclude:
- "/regular_ex.*ssions_are_supported/"
info

If you have set environments[$env].s3.auto_discover_disks to false, only the disks.include configuration parameter makes any sense.