Proxmox pve-zsync to MacOS

From W9CR
Revision as of 14:11, 8 September 2024 by Bryan (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


This is a very basic guide on using pve-zsync to send backups to a macos host with ZFS running on it via ssh.


configure repository

Lets first make the zfs dataset that all this will live under. We want to prevent the host os from seeing the virtual devices under it 'volmode=none' does this.

zfs create -o volmode=none ZfsMediaPool/proxback

Configure user on mac

We want to use and unprivileged account on osx and setup it to allow ssh.

sysadminctl -addUser proxback -home /Volumes/ZfsMediaPool/proxback/
chown -R proxback:wheel /Volumes/ZfsMediaPool/proxback/

Now we need to make the .ssh files to allow the sending proxmox hosts to ssh in as proxback.

You will need to grant this user ssh access in System Preferences > Sharing > Remote Login for ssh to work.

ZFS perms

Allow this user to do anything under the proxback dataset

zfs allow -u proxback create,destroy,mount,receive,send ZfsMediaPool/proxback

symlink the zfs binary

mac installs the zfs binary in the path, but the pve-zsync uses absolute paths. It's fixable, but easier to just symlink it on osx

ln -s /usr/local/zfs/bin/zfs /usr/sbin/zfs

configure ssh on proxmox

I use a nonstandard port number so in the .ssh/config file I need to setup my server:

Host proxback
        hostname IPADDRESS
        port 2022
        user proxback

ssh to the server

ssh to the server as root and test that you can login

ssh proxback


Do the first backup

time pve-zsync sync --compressed --source 116 --dest-user proxback --dest proxback:ZfsMediaPool/proxback --dest-config-path /Volumes/ZfsMediaPool/proxback/pve-sync --verbose --maxsnap 7 --name flowman

verify it made it on the server

# zfs list -r -t all ZfsMediaPool/proxback

NAME                                                               USED  AVAIL     REFER  MOUNTPOINT
ZfsMediaPool/proxback                                             51.7G  78.2T     2.59M  /Volumes/ZfsMediaPool/proxback
ZfsMediaPool/proxback/vm-116-disk-0                               51.7G  78.2T     51.7G  -
ZfsMediaPool/proxback/vm-116-disk-0@rep_test_2023-09-12_16:59:59     0B      -     51.7G  -

Now setup some recurring backups

By default this only works every 15 minutes. 7 is fine for daily, but if you don't edit it, it will need 96 to keep an entire day, or 672 for a week.

--skip will skip the inital backup.

pve-zsync create --compressed --source 116 --dest-user proxback --dest proxback:ZfsMediaPool/proxback --dest-config-path /Volumes/ZfsMediaPool/proxback/pve-sync --verbose --maxsnap 7 --name flowman --skip 

You can edit the command in

/etc/cron.d/pve-zsync 

crontab guru is a great help here.