Edit backup job via CLI

brancott

Member
Apr 11, 2022
9
0
6
Hi guys! I wonder how to edit existing pbs job via cli? I can create tasks with pvesh but how abiut editing them?

For example I need to transfer couple of hundreds backup jobs from one datastore to another. How do I do that?
 
Hi,
editing a Proxmox VE backup job can be done either via the API, see this endpoint and all the available methods https://pve.proxmox.com/pve-docs/api-viewer/index.html#/cluster/backup/{id} (you want to use the PUT methods for editing), or directly via the config file located at /etc/pve/jobs.cfg, which if you want to transfer the jobs is probably what you are looking for.
 
For future reference:

Bash:
# List all backup jobs
pvesh ls /cluster/backup

# Create a daily backup at 20:00 for VMs 213,214 and 215 to storage MY-PBS
pvesh create /cluster/backup --id backup-daily --schedule 20:00 --storage MY-PBS --vmid 213,214,215

# Get the configuration of a backup job
pvesh get /cluster/backup/{job-id}

# Remove a backup job
pvesh delete /cluster/backup/{job-id}

P.S. The Proxmox API is very extensive. Whenever possible, prefer to use the API instead of manually editing Proxmox configuration files.
 
  • Like
Reactions: Kosh, LEI and UdoB