View | Details | Raw Unified | Return to bug 215828
Collapse All | Expand All

(-)periodic-snapshot (-4 / +24 lines)
Lines 47-52 Link Here
47
    *            ) exit 0 ;;
47
    *            ) exit 0 ;;
48
esac
48
esac
49
49
50
#   explicitly check whether we should take care of ZFS to
51
#   prevent us from _implicitly_ loading "zfs.ko" without reason
52
zfs_enabled=`( \
53
    if [ -r /etc/defaults/rc.conf ]; then \
54
        . /etc/defaults/rc.conf; \
55
        source_rc_confs; \
56
    fi; \
57
    . /etc/rc.subr; \
58
    load_rc_config zfs; \
59
    if checkyesno zfs_enable; then \
60
        echo 'yes'; \
61
    else \
62
        echo 'no'; \
63
    fi
64
) 2>/dev/null || true`
65
50
#   determine run-time tag and current hour
66
#   determine run-time tag and current hour
51
time_tag="$1"
67
time_tag="$1"
52
time_hour=$((0 + `date '+%k'`))
68
time_hour=$((0 + `date '+%k'`))
Lines 87-96 Link Here
87
    OIFS="$IFS"; IFS="$IFS,"
103
    OIFS="$IFS"; IFS="$IFS,"
88
    for fs in $fs_list; do
104
    for fs in $fs_list; do
89
        IFS="$OIFS"
105
        IFS="$OIFS"
90
        #   sanity check filesystem snapshot schedule
106
	if [ ".$zfs_enabled" = .yes ] && (zfs list $fs) >/dev/null 2>&1; then
91
        if [ $((0 + $when_weekly + $when_daily + $when_hourly)) -gt 20 ]; then
107
	    :
92
            logger -p daemon.warning \
108
	else
93
                "snapshot: schedule $schedule on filesystem $fs would require more than maximum number of 20 possible snapshots"
109
            #   sanity check filesystem snapshot schedule
110
            if [ $((0 + $when_weekly + $when_daily + $when_hourly)) -gt 20 ]; then
111
                logger -p daemon.warning \
112
                    "snapshot: schedule $schedule on ufs filesystem $fs would require more than maximum number of 20 possible snapshots"
113
            fi
94
        fi
114
        fi
95
115
96
        #   determine whether to make a snapshot
116
        #   determine whether to make a snapshot

Return to bug 215828