Version 3.12.1

3.2.1. Discrete files backups

A discrete file backup is a regular file archive. Backups are created in GNU Tar format.

Requirements:

  • To make backups of your files, you have to ensure that you have installed GNU tar of whatever version is available on your OS.
  • To back up the files, nxs-backup must be running on the same host where the files are located. Files can be stored locally, or mounted to a local directory.
  • There should be enough space in the directory where the temporary backup is created.
  • The files should be readable by the user who runs nxs-backup.

Here is an example of configs for creating a backup of files WP projects located on-premise in directory /var/www with the exclude of log files.

This job config defines rules to make file backups for WordPress projects, stored in path /var/www/

job_name: desc_files
type: desc_files
tmp_dir: /var/backups/tmp_dump

sources:
  - name: "wp_projects"
    save_abs_path: yes
    targets:
      - /var/www/*/wp-content/
    excludes:
      - log
    gzip: true

storages_options: 
  - storage_name: local
    backup_path: /var/backups/files/desc
    retention:
      days: 2
      weeks: 0
      months: 0

If you need to configure additional storage options or have questions, please visit the Job storage options page for more details.

Reference of desc_files type

# Job unique name
job_name: string # Required

# Type of the backup job. `desc_files`
type: string # Required

# Path to the directory used to temporarily store the backup during the creation process
tmp_dir: string # Required

# The option defines the order of rotation (deletion of old) backups, before creating a new copy or afterwards
safety_backup: bool # Default: false

# The option allows you to postpone copying until all backup parts of the job are complete before its delivery
deferred_copying: bool # Default: false

# The option enables compression of the backup archive
gzip: bool # Default: false
    
# Contains resource constraints for a specific job that override all others.
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
  # 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

# Contains a list of individual subtasks for creating backups
sources: list 
    # Unique subtask name, used to separate storage paths
  - name: string # Required
    # List of paths for which backups will be created 
    targets: list 
        # Path to the files to be backed up. The glob format is supported, in this case a separate backup will be created for each occurrence.
      - string # Required
    # List of entries to exclude from backup
    excludes: list 
        # Entry to exclude from the backup. The glob format is supported.
      - string # Optional
    # The option enables compression of the backup archive, overwrites job level
    gzip: bool # Default: false
    # The option activates saving the absolute path of files in the archive
    save_abs_path: bool # Default: true

# List of storages to which backups should be delivered and their rotation rules
storages_options: list 
    # The name of the storage added to the main config. The name `local` is used to store a copy on host.
  - storage_name: string # Reuired
    # Path to directory where backups will be stored
    backup_path: string # Reuired
    # Enables backup rotation according to retention parameters.
    enable_rotate: bool # Default: true
    # Set of rules to store and rotate the backups.
    retention: map 
      # Use backup retention count instead of retention period.
      count_instead_of_period: bool # Default: false
      # Count of days/daily copies to store backups. Multiple copies can be created in one day.
      days: numeric # Default: 7
      # Count of weeks/weekly copies to store backups created on sunday.
      weeks: numeric # Default: 5
      # Count of months/montly copies to store backups created on the first day of month.
      months: numeric # Default: 12