Project

General

Profile

Submit #3287 ยป 220.diff

fgudin, 07/07/2021 05:46 AM

View differences:

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