Log disk usage of Hetzner backup spaces every day

Authored by nalvarez on May 5 2020, 8:23 PM.

Description

Log disk usage of Hetzner backup spaces every day

Add a script to get the disk usage of Hetzner backup spaces and send it
to InfluxDB. Getting the usage is done via the 'du' lftp command. Backup
credentials are stored in a separate config file, only readable by root
(like the backup scripts are now). The script sends data to Telegraf via
a Unix socket, which then forwards it to InfluxDB in its usual batch. It
runs in a cronjob at 2am (I'll make it configurable later).

It doesn't only get the total size of the backup storage, but also of
subdirectories up to depth 2. This means we get the backup size for each
host (nicoda-backups, komaci-backups), and also for each Borg backup
(borg-backups/nicoda-sites, borg-backups/bugs-database), but we don't
recurse further into Borg's internal subdirectories.

To enable this, set the backup_size_logging hostvar. It will then act on
the backup space used by that host (via hetzner_backup_host setting).
Currently only edulis is enabled, for testing.

Ref T13069

Details