Ubuntu zsys: Difference between revisions
From Lolly's Wiki
Jump to navigationJump to search
Line 1: | Line 1: | ||
[[category:Ubuntu]] | |||
==Cconfigure garbage collection== | ==Cconfigure garbage collection== | ||
<source> | <source lang=yaml> | ||
cat > /etc/zsys.conf <<EOF | cat > /etc/zsys.conf <<EOF | ||
history: | history: | ||
Line 55: | Line 56: | ||
timeout: 60 | timeout: 60 | ||
EOF | EOF | ||
systemctl restart | systemctl restart zsysd.service | ||
zsysctl service gc | |||
update-grub | |||
</source> | </source> |
Revision as of 09:48, 22 June 2021
Cconfigure garbage collection
cat > /etc/zsys.conf <<EOF
history:
# Keep at least n history entry per unit of time if enough of them are present
# The order condition the bucket start and end dates (from most recent to oldest)
# We also keep all previous state saves for the previous day.
# gcstartafter: 1 (GC start after a whole day).
gcstartafter: 1
# Minimum number of recent states to keep.
keeplast: 7
# - name: Abitrary name of the bucket
# buckets: Number of buckets over the interval
# bucketlength: Length of each bucket in days
# samplesperbucket: Number of datasets to keep in each bucket
gcrules:
- name: PreviousDay
buckets: 1
bucketlength: 1
samplesperbucket: 3
#
# For the previous Day (after on full day of retention of all
# snapshots due to gcstartafter: 1), the rule PreviousDay
# defines one bucket (buckets: 1) of size 1 day (bucketlength: 1),
# where we keep 3 states. So basically, we keep 3 states on the
# previous full day.
#
- name: PreviousWeek
buckets: 5
bucketlength: 1
samplesperbucket: 1
#
# For the 5 days before (buckets: 5 of size 1 day (bucketlength: 1)),
# we keep one state (samplesperbucket: 1).
# It means thus that we keep one state per day for each of those 5 days.
#
- name: PreviousMonth
buckets: 4
bucketlength: 7
samplesperbucket: 1
#
# We divide the previous month, in 4 buckets (buckets: 4) of
# 7 days each (bucketlength: 7) and keep one state for each
# (samplesperbucket: 1).
# In English, this means that we try to keep one state save
# per week over the previous month.
#
general:
# Minimal free space required before taking a snapshot
minfreepoolspace: 20
# Daemon timeout in seconds
timeout: 60
EOF
systemctl restart zsysd.service
zsysctl service gc
update-grub