OpsVault

Paths

Back up directories and files on the local filesystem.

The paths list defines directories or files to archive and back up. Each entry is compressed into a .tar.gz archive using the same pipeline as database backups — stored locally, uploaded via rclone, and pruned by retention rules.

Fields

paths:
  - name: myapp_uploads       # (required) Unique identifier, used in filenames
    path: /var/www/myapp/uploads  # (required) Absolute path to back up
    preset_excludes:          # Quick patterns to skip (see below)
      - node_modules
      - git
      - build
    excluded_paths:           # Custom patterns to skip
      - "*.log"
      - "cache/"
      - "config/secrets.yaml"
    enabled: true

Preset excludes

Select common patterns without memorizing flags. Each preset maps to one or more glob patterns applied at any depth in the directory tree.

KeySkips
node_modulesnode_modules/
vendorvendor/
git.git/
python__pycache__/, *.pyc, *.pyo, .venv/, venv/
builddist/, build/, target/, out/, .next/, .nuxt/
logs*.log, logs/
temp*.tmp, *.temp, tmp/, temp/
ide.idea/, .vscode/, *.swp
cachecache/, .cache/, *.cache
docker.docker/

Set them via opsvault configPathsQuick excludes using the checkbox picker, or list them directly in the YAML under preset_excludes.

Custom excluded paths

The excluded_paths field accepts glob patterns:

  • No / — matched against the file or directory name at any depth (*.log skips all log files anywhere in the tree)
  • Contains / — matched against the full path relative to the backup root (config/secrets.yaml skips only that specific file)
excluded_paths:
  - "*.log"          # all .log files, any depth
  - "tmp/"           # any directory named tmp/
  - "config/local.php"   # specific file at config/local.php

Excluded directories are skipped entirely — the archiver never descends into them. This makes excluding large directories like node_modules fast regardless of how many files they contain.

Archive format

Archives are saved as .tar.gz files:

{name}_{YYYYMMDD}_{HHMMSS}.tar.gz

For example: myapp_uploads_20240115_020001.tar.gz

File permissions are preserved in the archive. Symlinks are skipped.

Remote upload

Path archives are uploaded to rclone using the same storage.rclone settings as database backups. The {name} variable in the path template refers to the path entry's name field.

storage:
  rclone:
    enabled: true
    remote: "s3backup"
    path: "opsvault/{hostname}/{name}/{date}"

With a path named myapp_uploads, the remote destination would be: s3backup:opsvault/myserver/myapp_uploads/2024-01-15/

Retention

Path archives are pruned by the same retention rules as database backups — keep_last and keep_days apply to .tar.gz files in the backup directory.

Example

paths:
  - name: wordpress_uploads
    path: /var/www/wordpress/wp-content/uploads
    preset_excludes:
      - cache
    enabled: true

  - name: nginx_config
    path: /etc/nginx
    enabled: true

  - name: app_data
    path: /opt/myapp/data
    preset_excludes:
      - logs
      - temp
    excluded_paths:
      - "*.pid"
      - "sockets/"
    enabled: true

Running path backups

Path backups run automatically on the cron schedule alongside database backups. To run manually:

opsvault backup run                  # all databases + all paths
opsvault backup run myapp_uploads    # single path by name

On this page