As described in this post post, i modified the awesome script from Jörg Binnewald @ https://esc-now.de/ to suit my needs.
The script is automatically triggered, when the backup-HDD is attached to the TrueNAS-Server. The Datasets (and child-Datasets) are incrementally backed-up via send/receive (ZFS feature).
- truenas.poolbackup.sh (Backup script, triggert by devd rule)
- devd-backuphdd.conf (devd rule, connecting HDD)
- truenas-copy-devdconf.sh (Workaround, because TrueNas keeps killing the devd rule)