Bug 262685 - periodic 223.backup-zfs saving ever changing properties, unuseful daily e-mails
Summary: periodic 223.backup-zfs saving ever changing properties, unuseful daily e-mails
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 12.3-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-20 15:06 UTC by Miroslav Lachman
Modified: 2022-03-21 08:48 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Miroslav Lachman 2022-03-20 15:06:02 UTC
The script /etc/periodic/daily/223.backup-zfs should save informations about zpool and zfs layout and some useful properties. These informations should be useful for recreating the pool layout after some disaster (machine parseable?). I am the author of the original version from the PR 86388 and this was my intention.
There should not be any statistical information (compress ratio, space usage etc.)

These commands were used for this in the original 223.backup-zfs

zpool list -vp
zfs list -p -H -o name,mountpoint
zfs get -H -p -t filesystem,volume all | grep -E -v "available|compressratio|logicalreferenced|logicalused|refcompressratio|referenced|used|usedbychildren|usedbydataset|written" 
zpool get -H -p all | grep -E -v "capacity|dedupratio|free|allocated|fragmentation"

They were changed in committed version to simple

zpool list
zfs list 
zfs get
zpool get

But this breaks some things. Current and previous backup files are compared and differencies are being e-mailed. This committed version will see differences in things like compress ratio, space usage and other things which should not be included in the backed up informations.

Then this unuseful informations are being sent to the user just because there is difference in disk space useage

Backup of ZFS information for all imported pools
33,34c33,34
< sys/usr                                 10.0M  12.3G    88K  none
< sys/usr/home                            8.88M  12.3G  1.48M  /usr/home
---
> sys/usr                                 10.1M  12.3G    88K  none
> sys/usr/home                            8.89M  12.3G  1.48M  /usr/home
42c42
< sys/var/tmp                             3.38M  12.3G   148K  /var/tmp
---
> sys/var/tmp                             3.38M  12.3G   140K  /var/tmp
84c84
< tank0/vol0/web                           265M  9.80T  9.54M  /vol0/web
---
> tank0/vol0/web                           265M  9.80T  9.47M  /vol0/web


Also I don't see dumping properties for snapshots much useful but it can be painfully slow on systems with a lot of snapshots, that's why my original version had zfs get -H -p -t filesystem,volume all.
I see this can be changed in /etc/periodic.conf with daily_backup_zfs_get_flags but I think there should be more sane defaults.

I am using the original version from 2017 but now, after upgrading FreeBSD to version with 223.backup-zfs shipped in the base I am seeing long list of changes in each daily e-mail.

I really would like to talk to somebody who is in charge for periodic scripts and find a way to make it better for all users. I can provide patches if we agree on what and how should be done.