proxmox-backup-client
command0 1 * * * proxmox-backup-client backup home.pxar:/home/ --repository root@pam@IP_PBS:backup && proxmox-backup-client prune host/HOSTNAME --repository root@pam@IP_PBS:backup --keep-daily 14
#!/bin/bash
PBS_PASSWORD='mypassword'
PBS_FINGERPRINT='10:d3:7f:79:7e:e etcetera myfingerprint'
export PBS_PASSWORD
export PBS_FINGERPRINT
proxmox-backup-client login --repository root@pam@192.168.0.46:sauvegardes
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
proxmox-backup-client
backup command manually and it works great, but when adding to cron, the scheduled task simply passes by.cat /var/log/syslog | grep CRON
says it ran at the scheduled time, but nothing actually happens. If I run the script manually with bash /root/pbs.sh
I get errors before the backup runs:root@pve:~# bash pbs.sh
pbs.sh: line 2: $'\r': command not found
': not a valid identifierPBS_PASSWORD
': not a valid identifierPBS_FINGERPRINT
pbs.sh: line 7: $'\r': command not found
Error: parameter verification errors
parameter 'repository': value does not match the regex pattern
Usage: proxmox-backup-client login [OPTIONS]
Optional parameters:
--repository <string>
Repository URL.
Starting backup: host/pve/2023-05-10T08:33:00Z
pbs.sh
file is the same as in post #12 (-pruning), but I'll paste below.#!/bin/bash
PBS_PASSWORD='<mypass>'
PBS_FINGERPRINT='9c:39:f8:dd:c5...'
export PBS_PASSWORD
export PBS_FINGERPRINT
proxmox-backup-client login --repository root@pam@192.168.1.214:pbs-backups
proxmox-backup-client backup root.pxar:/ --repository root@pam@192.168.1.214:pbs-backups