π ~1 min read
Table of contents
Symptom & Impact
ZFS cleanup automation on FreeBSD 13 can cause data loss when dataset selection logic is unsafe.
Environment & Reproduction
Unexpected snapshots or child datasets disappear after scheduled prune jobs run.
Root Cause Analysis
Broad glob patterns, missing dataset allowlists, and untested destructive commands in scripts.
Quick Triage
Review cron logs, script arguments, and zfs history to identify exact deletion commands executed.
Step-by-Step Diagnosis
Stop scheduled pruning and snapshot current state immediately. image_ref=0

Solution – Primary Fix
Rewrite script with explicit dataset list, dry-run mode, and conservative retention logic before re-enabling. image_ref=1
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Solution – Alternative Approaches
Disable offending cron entry until validation completes and keep manual approval for destructive runs.
Verification & Acceptance Criteria
Store retention policy in a strict config file and validate dataset names against an allowlist.
Rollback Plan
Networking is secondary, but ensure backups replicate over permitted channels before deletion workflows.
Prevention & Hardening
Run dry-run output checks and compare intended deletion list against expected retention policy.
Related Errors & Cross-Refs
Add immutable backups, alert on destroy operations, and require two-person review for script changes.
Related tutorial: View the step-by-step tutorial for freebsd-13.
View all freebsd-13 tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Consult man zfs, man cron, and operational best practices for snapshot lifecycle management.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today β we respond within one business day.