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
This commit is contained in:
@@ -1,11 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
PBS_PASSWORD='guyisfree'
|
||||
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'
|
||||
export PBS_PASSWORD
|
||||
export PBS_FINGERPRINT
|
||||
# Use full repository syntax consistently
|
||||
REPOSITORY="root@pam@pve2.lan:pbs"
|
||||
|
||||
proxmox-backup-client login --repository root@pam@pve2.lan:pbs
|
||||
proxmox-backup-client backup root.pxar:/ etcpve.pxar:/etc/pve --repository pve2.lan:pbs --exclude /var/lib/vz
|
||||
proxmox-backup-client prune host/pve --repository pve2.lan:pbs --keep-daily 3 --keep-weekly 1 --keep-monthly 1
|
||||
#proxmox-backup-client backup root.pxar:/ --repository root@pam@192.168.0.46:sauvegardes && proxmox-backup-client prune host/se4fs --repository root@pam@192.168.0.46:sauvegardes --keep-daily 14
|
||||
# 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
|
||||
Reference in New Issue
Block a user