Skip to content

Resource: proxmox_backup_job

Manages a Proxmox VE cluster backup job.

Example Usage

resource "proxmox_backup_job" "daily_backup" {
  id       = "daily-backup"
  schedule = "*-*-* 02:00"
  storage  = "local"
  all      = true
  mode     = "snapshot"
  compress = "zstd"
}

Schema

Required

  • id (String) The identifier of the backup job.
  • schedule (String) Backup schedule in systemd calendar event format.
  • storage (String) The storage identifier for the backup.

Optional

  • all (Boolean) Whether to back up all known guests on the node.
  • bwlimit (Number) I/O bandwidth limit in KiB/s.
  • compress (String) The compression algorithm (0, 1, gzip, lzo, or zstd).
  • enabled (Boolean) Whether the backup job is enabled.
  • exclude_path (List of String) A list of paths to exclude from the backup.
  • fleecing (Attributes) Fleecing configuration for the backup job. (see below for nested schema)
  • ionice (Number) I/O priority (0-8).
  • lockwait (Number) Maximum wait time in minutes for the global lock.
  • mailnotification (String) Email notification setting (always or failure).
  • mailto (List of String) A list of email addresses to send notifications to.
  • maxfiles (Number) Deprecated: use prune_backups instead. Maximum number of backup files per guest.
  • mode (String) The backup mode (snapshot, suspend, or stop).
  • node (String) The cluster node name to limit the backup job to.
  • notes_template (String) Template for notes attached to the backup.
  • pbs_change_detection_mode (String) PBS change detection mode (legacy, data, or metadata).
  • performance (Attributes) Performance-related settings for the backup job. (see below for nested schema)
  • pigz (Number) Number of pigz threads (0 disables, 1 uses single-threaded gzip).
  • pool (String) Limit backup to guests in the specified pool.
  • protected (Boolean) Whether the backup should be marked as protected.
  • prune_backups (Map of String) Retention options as a map of keep policies (e.g. keep-last = "3", keep-weekly = "2").
  • remove (Boolean) Whether to remove old backups if there are more than maxfiles.
  • repeat_missed (Boolean) Whether to repeat missed backup jobs as soon as possible.
  • script (String) Path to a script to execute before/after the backup job.
  • starttime (String) The scheduled start time (HH:MM).
  • stdexcludes (Boolean) Whether to exclude common temporary files from the backup.
  • stopwait (Number) Maximum wait time in minutes for a guest to stop.
  • tmpdir (String) Path to the temporary directory for the backup job.
  • vmid (List of String) A list of guest VM/CT IDs to include in the backup job.
  • zstd (Number) Number of zstd threads (0 uses half of available cores).

Nested Schema for fleecing

Optional:

  • enabled (Boolean) Whether fleecing is enabled.
  • storage (String) The storage identifier for fleecing.

Nested Schema for performance

Optional:

  • max_workers (Number) Maximum number of workers for parallel backup.
  • pbs_entries_max (Number) Maximum number of entries for PBS catalog.

Import

Import is supported using the following syntax:

terraform import proxmox_backup_job.daily_backup daily-backup