Version 3.12.1

3.1. Preparing of the main config

Below is the main config. It contains general settings such as notification channels, remote storage, logging, and job list.

Example of the main config with mail notification:

server_name: wp-server
project_name: My Best Project

loglevel: info

notifications:
  mail:
    enabled: true
    smtp_server: smtp.gmail.com
    smtp_port: 465
    smtp_user: [email protected]
    smtp_password: some5Tr0n9P@s5worD
    recipients:
      - [email protected]
      - [email protected]
  webhooks: []
storage_connects: []
jobs: []
include_jobs_configs: [ "conf.d/*.conf" ]

This is the basic main config with mail notification. Strongly recommend using email notifications as the default method. If you need more features see reference.

Main config reference:

# The name of the server on which the nxs-backup is started. Used in notification channels, to identify the server being backed up.
server_name: string # Default: localhost

# The name of the project, used for notifications. Used in notification channels to identify the project that is being backed up.
project_name: string # optional

# Path to store log of executing. The log can be written to a file or to the standard output stream (stdout). Before running nxs-backup, make sure that the specified path is available to the user who is running the backup.
logfile: string # Default: stdout

# Each event in the log has a certain level: "error", "warning", "info", "debug". The minimum level of events for logging is defined here.
loglevel: string # Default: info

# Waiting time in minutes for a previously started backup to complete
waiting_timeout: numeric # Default: 0

# Contains parameters for server mode
server: map
  # Contains the TCP address for the server to listen on, in the form "host:port". If empty, ":http" (port 80) is used.
  bind: string # Default: ":7979"
  # Contains parameters of metrics server
  metrics: map
    # Enables metrics server
    enabled: bool # Default: true
    # Path to file contains backups metrics. Write to file on preforming backups, read in server mode.
    metrics_file_path: string # Default: "/tmp/nxs-backup.metrics"

# Contains generic resource constraints that can be overridden at a lower level.
limits: map
  # Limit the write speed to the local disc per second in `bytes`, `kb`, `mb`, etc. Example: "20mb".
  # If "0" is used, there is no limitation.
  disk_rate: string # Default: "0"
  # Limit the net speed to remote storages per second in `bytes`, `kb`, `mb`, etc. Example: "12mb".
  # If "0" is used, there is no limitation.
  net_rate: string # Default: "0"
  # Limit the count of used CPU's. Example: 4
  # If 0 is used, there is no limitation.
  cpu_max_count: numeric # Default: 0

# Contains notification channels parameters
notifications: map 
  # Contains email notification channel parameters
  mail: map 
    # Enables this notification channel 
    enabled: bool # Default: true
    # Mailbox on behalf of which mails will be sent
    mail_from: string # Required
    # SMTP host. If not specified mail will be sent using /usr/sbin/sendmail
    smtp_server: string # Required
    # SMTP port. 
    smtp_port: numeric # Default: 465
    # SMTP user login
    smtp_user: string 
    # SMTP user password
    smtp_password: string 
    # Each event in the log has a certain level: "error", "warning", "info", "debug". Here it defines the minimum level of events to be sent to email.
    message_level: string # Default: warning
    # List of email addresses of notification recipients
    recipients: list # Default: []
        # Email of a recipient
      - string 
  # Contains list of webhook notification channel parameters. 
  webhooks: list 
      # Enables this notification channel 
    - enabled: bool # Default: true
      # URL where the webhook request will be sent. POST method is used to send webhooks. When sending a POST request, the body is json. 
      webhook_url: string # Required
      # The json key is defined, which will contain the event message.
      payload_message_key: string # Required
      # Here you can define additional json key/value pairs to customize your request body. For example, to set style.
      extra_payload: map # Optional
      # Here you can define additional json key/value pairs to customize your request headers, if it is required. For example, to auth your request.
      extra_headers: map # Optional
      # Allows you to send a request to a server with a self-signed certificate.
      insecure_tls: bool # Default: false
      # Here it defines the minimum level of events to be sent to the webhook. Each event in the log has a certain level: "error", "warning", "info", "debug". 
      message_level: string # Default: warning

# Contains list of remote storage connection parameters. Each storage connection should have a unique name. Interaction with all storages is performed via API, no client installation is required. See strage references in the following pages.
storage_connects: list # Default: []

# List of jobs configs. See jobs references in the following pages.
jobs: []

# List of strings with glob to find jobs tasks. See jobs references in the following pages.
include_jobs_configs: ["conf.d/*.conf"]