[TUTORIAL] Install the backup client on ubuntu desktop 24.04

Rolland

Member
Jun 16, 2022
5
2
8
The following was tested and passed under VirtualBox's VM.
Basic environment:
1. remote PBS-SERVER
2. VirtualBox VM is Ubuntu Desktop 24.04,upgraded from 22.04 to 23.10 to 24.04

Steps:
1. setup the Proxmox release key
# wget https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg

2. Add pbs-client.list
# vi /etc/apt/sources.list.d/pbs-client.list
Add the following line
deb [arch=amd64] http://download.proxmox.com/debian/pbs-client bookworm main

3. Update
# apt update

4. Install proxmox-backup-client
# apt install proxmox-backup-client

5. It is recommended to reboot once
# reboot

6. Setting environment variables
Refer to https://pbs.proxmox.com/docs/backup-client.html#

# export PBS_REPOSITORY=user@pbs@myhostname:mydatastore

7. Check the environment variables
# env | grep PBS
PBS_REPOSITORY=user@pbs@myhostname:mydatastore

8, test the command line
# proxmox-backup-client backup root.pxar:/

--output----------------------------------------------------------------------------------------------------
Password for "user@pbs": ********
Starting backup: host/test-VirtualBox/2024-04-29T08:14:49Z
Client name: test-VirtualBox
Starting backup protocol: Mon Apr 29 08:14:55 2024
No previous manifest available.
Upload directory '/' to 'user@pbs@remoteIP:8007:mydatastore' as root.pxar.didx
skipping mount point: "boot/efi"
skipping mount point: "dev"
skipping mount point: "proc"
skipping mount point: "run"
skipping mount point: "snap/bare/5"
skipping mount point: "snap/core20/1974"
skipping mount point: "snap/core20/2264"
skipping mount point: "snap/core22/1122"
skipping mount point: "snap/core22/858"
skipping mount point: "snap/firefox/2987"
skipping mount point: "snap/firmware-updater/127"
skipping mount point: "snap/gtk-common-themes/1535"
skipping mount point: "snap/snap-store/959"
skipping mount point: "snap/snapd/21184"
skipping mount point: "snap/snapd/21465"
skipping mount point: "snap/snapd-desktop-integration/157"
skipping mount point: "snap/snapd-desktop-integration/83"
skipping mount point: "sys"
warning: file size increased while reading: "var/log/syslog", file will be truncated!
root.pxar: had to backup 6.793 GiB of 9.212 GiB (compressed 4.101 GiB) in 1880.72s
root.pxar: average backup speed: 3.698 MiB/s
root.pxar: backup was done incrementally, reused 2.42 GiB (26.3%)
Uploaded backup catalog (4.214 MiB)
Duration: 1880.77s
End Time: Mon Apr 29 08:46:16 2024
--output-----end--------------------------------------------------------------------------------------------

You can see the backup just now in the remote PBS SERVER.

9, build shell
# vi pbsc_backup.sh
-------------------------------------
#!/bin/bash
export PBS_REPOSITORY=user@pbs@myhostname:mydatastore
proxmox-backup-client backup test.pxar:/
-------------------------------------

# chmod +x pbsc_backup.sh

# ./pbsc_backup.sh

10. Add it to the crontab and run it once a day
# crontab -e
0 5 * * * * /bin/sh /root/pbsc_backup.sh
 
The following ansible role snippet works for Ubuntu 24.04

Code:
- name: Add pbs repo
  deb822_repository:
    name: pbs
    types: deb
    uris: http://download.proxmox.com/debian/pbs-client
    suites: bookworm
    components:
      - main
    signed_by: |-
       -----BEGIN PGP PUBLIC KEY BLOCK-----
       .
       mQINBGODZZwBEADMA2dbTBXHRkvaOApNhPSRhyuhVfImTCGrUEFMMaUZ0vrEZRf7
       wpG7MTVlrQ2gOMshieGU1Oo+Kat5z0MN3g5Q+tck/OG43NQXkoXUkfsV3fiGZ34d
       MyiNEYDJB3EcVnX+99OWYmhP2ZcY0rgkSxBFKYpwphclw0gTu7osFu8FB+xFykgi
       qqT5PjJryLg8ltE/srt7XTLRusMvPHdrw3OUF6xDIu7YsCsZ2CQu/5BlbWmbhG6J
       t3Du7la6t17RFa/jhdRuRPL37VXMLnvc4hQXxsyQgP13kkKXzSzNwgVKcJxzAz4Y
       eADAjtQmrnYnwRQahfiob7snTqtxdgE1pPBvSZS/1MXdjGU2nYFcuaOjXJKy2f8n
       tpjtXTkTiEDB36OF78K2E9OifrTuqliHylVrF5fPdNax993xcY/VA9DRaUp1WzQy
       7Aa95v25vfmdzRlEnlEmGKmXA0XJhUs+dy0vy+9uWwES9z9pL056FcH7NKfST/nF
       DwamTVWugKzhmADRSTIdiJ4hW9CfN7gFJxHsodmqUQ80EtJvjzzmtqXMNAv6Yu4o
       0H/9dNXlBZP4O4yazRWmZ9hcETbaupaP1sPGKdbYPaeU+eGDZkbhjAnYQXlg3h87
       nRlQUbWw/oa2CqBA7Z4udpQoeaTfogcHHiZSBIozy/LC5QfPKk/gu3PYPQARAQAB
       tDpQcm94bW94IEJvb2t3b3JtIFJlbGVhc2UgS2V5IDxwcm94bW94LXJlbGVhc2VA
       cHJveG1veC5jb20+iQJUBBMBCgA+FiEE9OE2xnzc5Brm3m/IEUCvj2OeDDkFAmOD
       ZZwCGwMFCRLMAwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQEUCvj2OeDDm5
       9w/8CCIfeNtNkrs9Q6WFZEd4Ot+an3UxU00M3QO74LAeLPj8wbCRG1iN3j19sv0e
       d6vSyLz9UX79HkiiAHta9GA15MmZa6uTrABBfF8xPpDUPadpPXSAQmaUhr3NgLIB
       6jUVWEoBuHpxSwE3DEGgNwypTqgAr0f30mr+iCOd3DcwgkhfIPwWX6GBRWEn8QUj
       U7M7jSm9ExtLGy+sBoXsFc4h8I2Q9Yrfe85oRZIHCRKsc1o8TuxvCB3YPntOSZJU
       VjV+o8PzTTjWhCjuY+OMKyiiOgbfrtsRhB4PzQ6ZG8655Q+QjAy9+boN0OO/lzRb
       /Jpup6zpOvOIWGouvZ77FtCquPzwBiOvxHm7wE2TTVTE48DJDdmzKNFaXf1DQMHA
       THLEiU4iI6KoBw+MYPCKSauas77dw4Ftm6jQA+BjtulzBMLT4nq65oQ8lAB7ukBH
       CYrI1qQIoGq0c3VuYcO36uW9kRI9InNSM6jymeZJ+SvrREvh+Izzwm1zf+oWtrw2
       cyFFF5pCtuaB3i2B1L0tPxi9NWEF7d3e43bkg10TK19Ea0UqgdnMdCHFvHDFz+BA
       LuYbTFey1WjOXavOEVfWkC0fpyGjFiMNWUp6FGrxfnOiG25hln+eCWWiWzcTgVJ6
       7mqm2XbzSMa8Z+7u6L+BTa8P7OZmuPyCjzIJtE1E1CXH+/o=
       =YZF1
       -----END PGP PUBLIC KEY BLOCK-----

- name: install pbs client
  apt:
    pkg:
      - proxmox-backup-client
    state: present
    update_cache: yes
 

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!