

Build the snapshot with the below file
btrfs subvolume snapshot -r /path-to-sv/subvol /path-to-sv/subvol.ro
# send the subvolume to file, compress with parallel ZSTD & monitor progress
btrfs send /path-to-sv/subvol.snap.ro | \
pv -c | pzstd -16 | pv -c | \
dd of=/path-to-external-backup/subvol.zstd.back
# delete read-only snapshot
btrfs subvolume delete /path-to-sv/subvol.ro
To restore subvolume from backup we run the process in reverse:
# read backup file and decompress the stream, redirect to temporary read-only snapshot
dd if=/path-to-external-backup/subvol.zstd.back | \
pv -c | pzstd -d | pv -c | \
btrfs receive /path-to-sv/
# make a RW subvolume
btrfs subvolume snapshot subvol.ro subvol
# delete temporary snapshot
btrfs subvolume delete /path-to-sv/subvol.ro
From here
https://superuser.com/questions/1396241/btrfs-imaging-a-volume-to-an-external-file
You might want to make this into a systemd timer to run at boot or before shutting down
https://linuxconfig.org/how-to-schedule-tasks-with-systemd-timers-in-linux
Quadlet is a game changer
https://www.redhat.com/en/blog/quadlet-podman