How to automate backup process?

oermolaev

Active Member
Mar 27, 2014
7
0
41
I include a script with the task in the cron:
Code:
proxmox-backup-client backup etc.pxar:/etc/ --repository root@pam@ip.address.pbs:store1
But I get the error:
Code:
Error: no password input mechanism available
How to automate backup process correctly?
 
I created a script like the following (I didn't want to leave the passwords as variables, so I cleared them after use):

export PBS_PASSWORD=PASSWORD
export PBS_ENCRYPTION_PASSWORD=PASSWORD (If you don't use encryption you can leave this line out)
export PBS_REPOSITORY=root@pam@ip.address.pbs:store1
proxmox-backup-client backup etc.pxar:/etc --keyfile /root/office.key
export PBS_PASSWORD=
export PBS_ENCRYPTION_PASSWORD=
export PBS_REPOSITORY=

Then I run this as a cron job.
There maybe a better way, that is just what I came up with.
 
  • Like
Reactions: oermolaev
I agree with the plain text password issue. I currently have the script in my /root folder so only root has access. I also have the backups limited by the prune settings on the PBS. I currently keep 7 days, 4 weeks, 2 months, 1 year.
 
  • Like
Reactions: oermolaev
Thank you.

How would you exclude some folders in your script?

Best regards,
Andreas
 
you could also use an API token that is just allowed to make backups, but not delete anything (while still being tied to your user account).
 
  • Like
Reactions: rakurtz
Thank you @entilza for this helpful information. I can confirm: /etc/pve/ content is EMPTY.

How would I implement this --include-dev into the script that Ryan Anderson build?
 
Thank you @entilza for this helpful information. I can confirm: /etc/pve/ content is EMPTY.

How would I implement this --include-dev into the script that Ryan Anderson build?

You're Welcome!

Just add it to this line:

proxmox-backup-client backup etc.pxar:/etc --include-dev --keyfile /root/office.key

PS. The reason it doesnt' backup is /etc/pve is a special mounted /dev/fuse
 
Last edited:
Just tried but getting this error message:

'parameter 'include-dev': missing parameter value.'

The manual says there is a string missing.

Can you please also explain what the --keyfile is/does?
 
Just tried but getting this error message:

'parameter 'include-dev': missing parameter value.'

The manual says there is a string missing.

Can you please also explain what the --keyfile is/does?

ok mine is:

proxmox-backup-client backup pve-etc.pxar:/etc --include-dev /etc/pve

I believe keyfile is for encryption I don't use that.
 
  • Like
Reactions: vdm
I confirm that works and /etc/pve has content now.

It's a super important and good to know Lifesaver-Information !

I use proxmox file backup exactly to back up my nodes conf files and in "case of" I would have had no conf files, till today.
Happy new year ;o)
 
Yeah I figured, I mean we all browse the net search for solutions but then in the end if you don't fully test it or double check you can easily run into this scenario! I mean I myself went in and saw /etc/pve there I just assumed it was there was happy but then I went in to triple check and was like where are my files?! Cheers
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!