~rgrjr/web-site

ba684422c6b7c084679f8eaaff8ab02ca722ff5b — Bob Rogers 3 years ago 0904e62 rewrite-backup-page
* linux/backup.html:
   + Complete the "Tidying up with clean-backups.pl" section.
1 files changed, 60 insertions(+), 1 deletions(-)

M linux/backup.html
M linux/backup.html => linux/backup.html +60 -1
@@ 771,7 771,66 @@ bugs, and other details.
<a name="clean-backups.pl">
<h3>Tidying up with <tt>clean-backups.pl</tt></h3>

[tbd.  -- rgr, 26-Jan-21.]
<p>When following the <a href="#inc-levels">modified Tower of Hanoi
backup level scheme described above</a>, daily backups (those with a
backup level of 2 or greater) contain only one or two days worth of
data.  Odd dailies (3, 5, 7, and 9) have only one day, and even dailies
(2, 4, 6, and 8) have two days -- that day plus that of the previous odd
daily.  Consequently, it is less important to keep dailies around for
extended periods of time, so they can be deleted automatically when they
are no longer useful.  This is what <tt>clean-backups.pl</tt> does:
Maintains a specified minimum amount of free space on the filesystem
partition that is used for backups by removing first odd dailies that
are older than a specified threshold, starting with the oldest, and if
that does not restore enough space, it then removes even dailies.  No
output is generated except when <tt>clean-backups.pl</tt> fails to make
its quota, which makes it work well as a <tt>cron</tt> job; the sysadmin
gets an email when it's time to think about removing consolidated dumps.
</p>

<p>Full and consolidated backups cover much longer time periods, and are
usually kept around for much longer.  For this reason,
<tt>clean-backups.pl</tt> never deletes full or consolidated backups.
</p>

<p>Usage is as follows:
</p>

<pre>
            clean-backups.pl [ --conf=&lt;config-file> ]
                             [ --[no]test ] [ --verbose ... ]

            clean-backups.pl [ --usage | --help ]
</pre>

<p>The default configuration file is <tt>/etc/backup.conf</tt>, which
tells which partitions to clean, and how thoroughly to clean them.  Here
is an example:
</p>

<pre>
    # Backup configuration.

    [scorpio:/scratch]
    min-free-space = 10
    min-odd-retention = 60
    min-even-retention = 120
    clean = home

    [orion:/scratch]
    min-free-space = 0.5
    min-odd-retention = 60
    min-even-retention = 120
    clean = home
</pre>

<p>Notice that the same configuration file is shared between two
systems.  Minimum retention is specified as a number of days, and the
even and odd retention values are specified separately.  The
<tt>min-free-space</tt> is specified in GiB, and the <tt>clean</tt>
tells which prefixes should be cleaned. in the event that multiple
backup sets are stored on that partition.
</p>

<p>
<hr>