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
26 lines
759 B
Bash
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 |