Project

General

Profile

Submit #3287 ยป 220.diff

fgudin, 07/07/2021 05:46 AM

View differences:

etc/periodic/daily/220.snapshot-hammer2
54 54
               fi
55 55
               _df=$(df ${dir} | grep -oE "[0-9]+%")
56 56
               _pcnt=${_df%%%}
57
               if [ ${_pcnt} -gt ${snap_capacity} ]; then
58
                       echo "omitted, not enough free space"
59
                       continue
57
               if [ ${_pcnt} -le ${snap_capacity} ]; then
58
                       hammer2 snapshot ${dir} ${dir}.${snap_tag}.$(date +%Y%m%d.%H:%M) \
59
                               || rc=1
60
               else
61
                       echo "snapshot creation omitted, not enough free space"
60 62
               fi
61
               hammer2 snapshot ${dir} ${dir}.${snap_tag}.$(date +%Y%m%d.%H:%M) \
62
                       || rc=1
63 63
               _keep=${snap_keep}
64 64
               if [ "${_keep}" = "auto" ]; then
65 65
                       # adjust number of snapshots dynamically, according to free space
    (1-1/1)