The Handbook

    Theme
    • Guides
        • Check a system before installing FreeBSD
        • Orient a Linux administrator on FreeBSD
        • Supported FreeBSD releases
        • Choose a FreeBSD documentation and support channel
        • Move files safely without GNU mv -t
        • Update, upgrade, or update packages?
        • Upgrade 14.4 or 15.0 to FreeBSD 15.1
        • Choose packages, ports, or poudriere
        • Choose the quarterly or latest package branch
        • Choose a FreeBSD download or package mirror
        • Make a system setting persistent
        • Configure locale, keyboard, and time zone
        • Configure a serial console for recovery
        • Choose a custom kernel, module, or loader setting
        • Run a Linux binary with the compatibility layer
        • Check desktop and laptop hardware before installation
        • Choose and check a graphics driver
        • Choose Xorg or Wayland
        • Build a maintainable desktop baseline
        • Install and check a desktop browser
        • Check laptop Wi-Fi, power, and suspend
        • Check multimedia readiness
        • Choose and configure a printing stack
        • Run Windows applications with Wine
        • Snapshot and replicate a ZFS dataset
        • Choose a filesystem and storage layout
        • Operate ZFS without losing the recovery path
        • Restore files from a ZFS snapshot
        • Read ZFS pool health and run a scrub
        • Replace a failed device in a ZFS mirror
        • Replicate a ZFS dataset over SSH
        • Change PF safely on a remote host
        • Configure a narrow WireGuard tunnel
        • Plan a FreeBSD home server
        • Choose a mail server or an outgoing relay
        • Publish a network service safely
        • Choose a jail network model
        • Choose native jails or a jail manager
        • Choose a jail or a bhyve virtual machine
        • Establish a FreeBSD security baseline
        • Choose a MAC policy
        • Audit security-relevant activity
        • Start a DTrace performance investigation
    • Integrations
        • Create a first jail with Bastille
        • Compare jail managers and OCI tooling
        • Publish a Bastille service through PF
        • Mount a ZFS dataset in a Bastille jail
        • Update and upgrade Bastille jails
        • Back up and restore a Bastille jail
        • Prepare bhyve and vm-bhyve
        • Choose NFS or Samba for file sharing
        • Choose ZFS backup automation
        • Operate a signed poudriere repository
        • Manage FreeBSD configuration with Ansible or Salt
        • Run Motion with webcamd on FreeBSD
        • Design a reverse proxy, certificates, and monitoring
    • FAQ
      • Troubleshooting
          • Recover an interrupted freebsd-update run
          • Resolve a package repository or ABI mismatch
          • Diagnose the FreeBSD boot path
          • Recover with a ZFS boot environment
          • Diagnose DNS, routing, and firewall paths
          • Diagnose network mbuf exhaustion
          • Bind a service to a low port without running it as root
          • Diagnose audio output or input
          • Diagnose webcamd, cuse, and a webcam
          • Fix USB device permissions without opening every device
      • About this handbook
      • Synopsis
      • Compare the operating models
      • Preserve the same safety contract
      • Keep native automation transparent
      • Qualify zrepl
      • Qualify zfs-autobackup
      • Qualify Sanoid and Syncoid
      • Prove recovery before migration
      • Primary references

      Choose ZFS backup automation

      Last reviewed
      13 August 2026
      Applies to
      15.1-RELEASE, 15.0-RELEASE, 14.4-RELEASE

      Synopsis #

      ZFS replication tools coordinate snapshots, incremental send streams, retries, retention, and reporting. They do not turn an online replica into an independent backup. Credentials that can overwrite the destination, untested restores, and shared failure domains remain architectural risks regardless of the scheduler.

      Establish one successful full and incremental transfer with ZFS replication over SSH before selecting automation. That exercise exposes the dataset hierarchy, encryption mode, delegation, and recovery behavior that an automation tool must preserve.

      Compare the operating models #

      ApproachModelStrong fitPrincipal cost
      Native scriptzfs snapshot, zfs send, zfs receive, SSH, and a schedulerSmall, stable dataset set with locally reviewable codeRetention, resume state, locking, and observability must be engineered
      zreplLong-running jobs for snapshotting, push or pull replication, pruning, and monitoringMultiple datasets needing managed replication state and structured statusAnother daemon and configuration format; upstream documents no stability guarantee
      zfs-autobackupCommand-driven policy with dataset properties and a schedulerProperty-selected datasets and a comparatively small operational surfacePython runtime, command-line policy, and locally designed scheduling and alerting
      Sanoid and SyncoidPolicy-driven snapshots plus a command-line replication utilityExisting Sanoid retention policy and explicit Syncoid jobsFreeBSD-specific shell and installation behavior must be qualified

      No row is a popularity ranking. Select the smallest model that supplies required failure handling without hiding state that cannot be recovered during an incident.

      Preserve the same safety contract #

      Every candidate should be evaluated against one written contract:

      • source datasets and recursive child behavior;
      • snapshot names, application quiescence, and retention on each side;
      • full and incremental stream behavior;
      • native encryption and whether raw sends are required;
      • push or pull credentials and their delegated ZFS permissions;
      • resume behavior after process, network, or destination failure;
      • treatment of destination-only snapshots and dataset divergence;
      • capacity thresholds and last-success alerts;
      • restore procedure and test frequency.

      Retention is a destructive operation. Test pruning against disposable datasets before granting an automation account permission to destroy snapshots. Keep the destination unmounted or isolated when it is not intended to serve production data.

      Keep native automation transparent #

      A native script can be appropriate when the dataset set is small and the operator is prepared to own every state transition. It should refuse to proceed when a prerequisite is ambiguous rather than guessing.

      At minimum, the script must:

      1. take a lock so runs cannot overlap;
      2. identify and verify the last common snapshot;
      3. estimate the intended stream before sending it;
      4. distinguish a resumable receive from a new transfer;
      5. verify the received snapshot before pruning either side;
      6. emit machine-observable success, failure, duration, and byte counts;
      7. return a nonzero status on partial work.

      Do not parse human-oriented zfs list output without selecting stable fields. Do not use zfs receive -F as a routine divergence fix; it can destroy destination changes. The snapshot and replication guide covers the base mechanism.

      Qualify zrepl #

      Current zrepl documentation describes periodic snapshots, push and pull replication, SSH and authenticated TCP transports, resumable transfers, automatic holds and bookmarks, flexible pruning, structured logs, zrepl status, and a Prometheus endpoint.

      Those features make zrepl suitable where replication cursor protection and observable job state would otherwise become substantial local code. Its upstream documentation also states that the project remains under active development and does not guarantee RPC or configuration-format stability. Package and configuration upgrades therefore require changelog review and a staged test.

      Verify which side controls pruning, how remote authorization is constrained, and how a job is reconstructed from configuration plus on-disk holds and bookmarks. Do not manually remove zrepl-managed holds or bookmarks during ordinary cleanup.

      Qualify zfs-autobackup #

      The zfs-autobackup upstream project states that it is tested with FreeBSD and selects datasets through a ZFS property. It provides snapshot thinning, holds, resumable transfers, rate limiting, test output, and local or remote modes, while needing installation on only one side.

      This model can be easier to audit than a two-ended daemon when a scheduler and alert transport already exist. Qualification should still prove the exact OpenZFS feature combination on both endpoints, especially when operating-system versions differ. Upstream documents that unsupported received properties can cause cross-platform transfer errors.

      Keep the complete command line, property selection, scheduler entry, and retention decision in version control. A command that works interactively but lacks a durable schedule and failure alert is not backup automation.

      Qualify Sanoid and Syncoid #

      Sanoid manages snapshot creation, thinning, and monitoring from policy. Syncoid is its command-line replication utility and can push or pull through SSH without a Sanoid configuration file.

      The upstream repository includes a FreeBSD-specific note: Syncoid expects a Bourne-style remote shell, while the traditional FreeBSD root shell is not necessarily compatible with its redirects. The same note describes path adjustments needed by direct upstream installations. Prefer the maintained FreeBSD package when available, and verify the installed scripts and remote shell rather than applying historical upstream edits blindly.

      Sanoid and Syncoid are a useful fit when policy-driven local snapshots and individually scheduled replication jobs are desired. Their two responsibilities remain distinct: a Sanoid retention policy does not establish a remote authorization boundary, and a successful Syncoid run does not prove a restore.

      Prove recovery before migration #

      Run the chosen candidate against disposable source and destination datasets. Exercise:

      • initial replication and two incrementals;
      • an interrupted stream and documented resume behavior;
      • source snapshot pruning around the last common point;
      • a destination capacity failure;
      • an authentication failure;
      • a restored clone or isolated receive with representative application data.

      Migration from another tool must account for its snapshots, holds, bookmarks, resume tokens, and destination properties. Running two pruning engines over the same snapshot namespace is unsafe unless their ownership rules have been designed to coexist.

      See restore files from a snapshot and plan a home server for recovery and failure-domain context.

      Primary references #

      • FreeBSD Handbook: ZFS replication
      • zfs-send(8)
      • zfs-receive(8)
      • zrepl documentation
      • zrepl overview and terminology
      • zfs-autobackup project
      • Sanoid and Syncoid project
      • Sanoid and Syncoid FreeBSD notes

      Independent documentation. Not affiliated with or endorsed by the FreeBSD Project or the FreeBSD Foundation.

      Report a bug
      • Synopsis
      • Compare the operating models
      • Preserve the same safety contract
      • Keep native automation transparent
      • Qualify zrepl
      • Qualify zfs-autobackup
      • Qualify Sanoid and Syncoid
      • Prove recovery before migration
      • Primary references