Skip to main content

Repair VM backups with the backups CLI

VKB-1094How-to
📦 Applies to
Xen Orchestra
🗓️ Created
2024-03-14
🔄 Updated
2026-08-12

Environment​

A machine that can reach the backup remote, with npm available. See the upstream documentation for the full option list.

Procedure​

  1. Install the npm package:

    root@dom0
    # npm install --global @xen-orchestra/backups-cli
  2. Run it against the VM backup directories. Without a flag it only reports what it finds, which is the right first pass:

    root@dom0
    # xo-backups clean-vms xo-vm-backups/*
  3. Once the report looks right, act on it:

    root@dom0
    # xo-backups clean-vms --merge --remove xo-vm-backups/*

    --merge continues merging VHD files that are unused. --remove deletes files that are unused, incomplete, orphaned or corrupted.

Verification​

Re-run the command with no flags. A clean run reports nothing to do. Run a backup job afterwards to confirm the chain is usable.

Run the reporting pass first every time. --remove deletes backup data, and the report is what tells you whether that is what you want.