Files
configs/pve2/root/pbs.sh
admin 6230d7b587 Update pve2/root/pbs.sh
Added functionality to store the password in a cred file in /root/creds/pbs.creds
I didn't really worry about the pbs fingerprint getting out so I don't care to put it in a file
2025-03-27 11:40:03 -07:00

26 lines
759 B
Bash

#!/bin/bash
# Use full repository syntax consistently
REPOSITORY="root@pam@pve2.lan:pbs"
# Set environment variables FIRST
export PBS_PASSWORD_FILE=/root/creds/pbs.creds
export PBS_FINGERPRINT='fb:70:81:2c:5b:37:f7:f1:58:12:b8:cd:8b:ce:28:95:23:e6:7d:74:cb:57:93:bc:0d:61:61:03:f0:3a:09:1c'
# Verify password file permissions (crucial in case you changed it and forgot!)
chmod 600 /root/creds/pbs.creds
# Login command
proxmox-backup-client login --repository "$REPOSITORY"
# Backup command
proxmox-backup-client backup root.pxar:/ etcpve.pxar:/etc/pve \
--repository "$REPOSITORY" \
--exclude /var/lib/vz
# Prune command
proxmox-backup-client prune host/pve \
--repository "$REPOSITORY" \
--keep-daily 3 \
--keep-weekly 1 \
--keep-monthly 1