Bookmarks

    Nothing saved yet. Use the bookmark on any article. Bookmarks are kept on this device only: they stay private and work without an account.

    Settings

    Appearance

    Reading mode

    Font size

    Content width

    Line spacing

    Keyboard shortcuts

    /
    Search
    j k
    Next / previous story
    ← →
    Previous / next section (columns)
    b
    Bookmarks
    s
    Settings
    r
    Columns / scroll
    t
    Light / dark

    Saved in this browser only.

    Ping2Prompt
    Subscribe to the Weekly Brief Sign in
    An open hard disk drive with its cover removed, showing a silver platter and spindle on a black metal base.
    Photo by Nick on Unsplash

    Build a pull-based off-site copy of your Proxmox backups in one afternoon

    Automated source check Documentation reviewed

    Proxmox VE

    What you get

    By the end, an off-site Proxmox Backup Server pulls the contents of an on-site datastore into its own datastore on a schedule. The threat is losing every copy at once, through a site failure, a bad prune, or a stolen login. A prune alone does not free the data, because it removes snapshot metadata and chunks go only when garbage collection runs.

    The supplied PBS docs do not cover S3, object lock, verify jobs, append-only permissions, a restore drill, or the 3-2-1-1-0 rule. So this is a partial build, and we flag each gap where it matters. No source defines the digits, so this is our own convention and not a PBS claim.

    We read the rule's digits as three copies, two media types, one off-site, one immutable, and zero errors on restore. This build covers the off-site copy and the retention. It leaves immutability and the restore drill to you.

    Before you start

    You need two PBS installations, because a remote is a separate PBS installation plus a user on it. Pin the release you tested on both servers. Run every command below on the off-site server, because a sync job pulls remote data into the local datastore.

    Have the on-site hostname or IP, a userid and password on it, and its certificate fingerprint ready. Here is the one decision to make up front: should deletions on-site be copied off-site? The remove-vanished sync option deletes snapshots, groups and namespaces locally when they disappear from the remote.

    It also needs Datastore.Prune on the local datastore. For this build, leave it off, so the off-site side keeps its own retention.

    The goal is that nothing on the on-site server holds a login to the off-site one. The docs do not say whether pulling protects you if on-site credentials leak, so do not assume it does.

    Step 1

    Get the on-site fingerprint. On the on-site server, run proxmox-backup-manager cert info (verify before running). You can also use Dashboard > Show Fingerprint.

    Copy the value to the off-site server. It worked if you hold a fingerprint string you can paste into the next step.

    Step 2

    Create a dedicated sync user on the on-site server, such as sync@pam. The docs give no commands for creating the user or its permissions, so use your usual method. A sync job can only sync groups that the configured user or API token can read.

    If that user holds only Datastore.Backup, only the snapshots it owns are synced. That can leave guests out of your copy, so check which groups the user can read. On the pulling side, the job needs Remote.Read on /remote/{remote}/{remote-store}.

    It needs at least Datastore.Backup on the local target datastore. Datastore.Modify is required if the owner option is unset or names another user. You are done when the user exists and you know which groups it can read.

    Step 3

    Create the remote on the off-site server. The docs show: proxmox-backup-manager remote create pbs2 --host pbs2.mydomain.example --userid sync@pam --password 'SECRET' --fingerprint (verify before running). Swap in your own name, host, password and fingerprint.

    The remote configuration is stored in /etc/proxmox-backup/remote.cfg. It worked if your new remote has an entry in that file.

    Step 4

    Create the scheduled sync job on the off-site server. The docs show: proxmox-backup-manager sync-job create pbs2-local --remote pbs2 --remote-store local --store local --schedule 'Wed 02:30' (verify before running). The schedule is a calendar-event string, so pick a time that suits you.

    The job configuration is stored in /etc/proxmox-backup/sync.cfg. The group-filter option limits the job to matching groups, using type:ct, group:vm/100 or regex:'...'. Prefix a filter with exclude: to invert it.

    The verified-only and encrypted-only flags limit syncing to snapshots that are verified or encrypted. The docs call this of particular interest for a less trusted remote backup server.

    Run the job once by hand with sync-job run (verify before running). It worked if the local datastore now holds groups from the on-site datastore.

    Step 5

    Set retention on the off-site side with a prune job. A prune job runs on a datastore or a subset of it. Its settings are store, ns, max-depth, schedule, keep-X, disable and comment.

    Manage it with proxmox-backup-manager prune-job or the Prune & GC tab in the GUI. The config lives in /etc/proxmox-backup/prune.cfg. The options are keep-last, keep-hourly, keep-daily, keep-weekly, keep-monthly and keep-yearly, each with a number.

    They are processed in that order, and each covers only older backups not already covered. Snapshots with future timestamps are always kept. The docs give an example for daily backups kept ten years: keep-last 3, keep-daily 13, keep-weekly 8, keep-monthly 11. The excerpt cuts off before the yearly value, so choose your own.

    Pruning removes only metadata until garbage collection runs. Unreferenced chunks are marked in one GC run and removed by a later run after a grace period. The excerpts give no length for that grace period.

    Choose a garbage collection schedule and write it down. Use the built-in prune simulator before you enable the job. It worked if the simulator keeps the snapshots you expect.

    Step 6

    Keep secrets out of scripts. The client reads PBS_PASSWORD, or an API token secret, from the environment. It also accepts PBS_PASSWORD_FILE, _FD and _CMD variants.

    Encryption uses PBS_ENCRYPTION_PASSWORD, with the same _FILE, _FD and _CMD variants. PBS_FINGERPRINT supplies the certificate fingerprint for verification. Prefer the file or command variants over a password typed into a crontab.

    If you encrypt on the client, store the key somewhere other than either server. It worked if no script on either machine contains a plain password.

    Verify

    Run these checks after the first scheduled run. Check that /etc/proxmox-backup/sync.cfg lists your job. Check that the off-site datastore holds the groups the sync user can read.

    Do not expect disk space back after a prune alone. Expect it only after garbage collection has run, and again after the grace period for unreferenced chunks. The supplied docs do not cover verify jobs, so follow the PBS documentation to create and schedule them.

    With verified-only set, the sync is limited to snapshots that have been verified. Do a test restore of one guest and one file to a scratch host. Repeat it on a calendar and count the errors, with zero as the target.

    The docs offer no restore procedure, so write your own and keep it with the encryption key. Treat the copy as not immutable, because the docs cover no object lock or append-only permissions.

    Rollback

    Before you change anything, copy remote.cfg, sync.cfg and prune.cfg aside. Confirm that remove-vanished was never enabled, because it deletes local snapshots. Disable the prune job with its disable setting before you delete it.

    Remove the sync job with the matching sync-job subcommand of proxmox-backup-manager, and check its help output first. Then remove the remote entry.

    Last, revoke the sync user on the on-site server. Your on-site backups stay untouched by all of this.

    Sources

    Image: Photo by Nick on Unsplash


    This story was produced with AI assistance from the sources listed above and fact-checked against them before publication. Read our editorial methodology and the corrections log. Spotted an error? Email [email protected].

    Continue

    Share on Bluesky · Mastodon · Email ·

    Discussion