系统环境:
Ubuntu 20.04、Debian 10、Debian 11
安装 Proxmox Backup Client (PBC) 客户端:
apt update && apt install wget gnupg gnupg1 gnupg2 -y
echo "deb [arch=amd64] http://download.proxmox.com/debian/pbs-client buster main" >> /etc/apt/sources.list # Ubuntu 20.04、Debian 10 执行这条命令
#echo "deb [arch=amd64] http://download.proxmox.com/debian/pbs-client bullseye main" >> /etc/apt/sources.list # 如果是 Debian 11 执行这条命令
wget http://download.proxmox.com/debian/proxmox-release-bullseye.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7BF2812E8A6E88E0
apt update && apt install proxmox-backup-client -y
创建备份:
export PBS_REPOSITORY=root@[email protected]:8007:test && export PBS_PASSWORD=YourPassword && proxmox-backup-client backup test.pxar:/www/test
备份命令说明:
PBS_REPOSITORY=用户名或者API令牌@
主机地址:
端口:
在 PBS 中的存储路径 (注意:如果用 API 令牌作为用户名,需要把 API 令牌中的叹号通过反斜杠转译 user@pbs\
!token)
PBS_PASSWORD=密码或者 API KEY
test.pxar:/www/test 要打包成的文件名 test.pxar 和要打包的文件夹路径 /www/test
查看备份:
export PBS_REPOSITORY=root@[email protected]:8007:test && export PBS_PASSWORD=YourPassword && proxmox-backup-client snapshot list
恢复备份:
export PBS_REPOSITORY=root@[email protected]:8007:test && export PBS_PASSWORD=YourPassword && proxmox-backup-client restore host/vieux/2021-08-15T17:00:08Z test.pxar /www/test-new/
参考资料:
Proxmox Backup Client 官方文档:
https://pbs.proxmox.com/docs/backup-client.html#backup-repository-locations
Proxmox Backup Client 命令语法:
https://pbs.proxmox.com/docs/command-syntax.html#proxmox-backup-client