@@ -567,6 +567,45 @@ that is not a bind mount and one of `ext{2,3,4}`, `xfs` or
`modules/bacula/files/bacula-backup-dirs` Puppet file, deployed in
`/usr/local/sbin/bacula-backup-dirs` on backup clients.
## Retiring a client
<!-- keep this section in sync with howto/retire-a-host -->
Clients are managed by Puppet and their configuration will be
automatically removed from the host is removed from Puppet. This is
normally part of the [host retirement procedure][].
[host retirement procedure]:howto/retire-a-host
The procedure also takes care of removing the data from the backup
storage server (in `/srv/backups/bacula/`, currently on `bungei`), but
not PostgreSQL backups or the catalog on the director.
Incredibly, it seems like no one really knows how to remove a client
from the catalog on the director, once they are gone. Removing the
configuration is one thing, but the client is then still in the
database. There are [many](https://adsm.org/lists/html/Bacula-users/2013-10/msg00040.html), [many](https://sourceforge.net/p/bacula/mailman/bacula-users/thread/CAPTZE3uoxyVU4YVSmirygddeKjZaiNHovV6gPy4Oxib0fekR0w%40mail.gmail.com/#msg36198382), [many](https://www.backupcentral.com/forum/19/255655/howto_remove_clients_permanently_and_completely_from_backup), [many](https://sourceforge.net/p/bacula/mailman/message/22922461/_),
[questions](https://serverfault.com/questions/471057/remove-bacula-client-from-server) about this *everywhere*, and everyone [gets it
wrong](https://adsm.org/lists/html/Bacula-users/2013-10/msg00073.html) or [doesn't care](https://adsm.org/lists/html/Bacula-users/2013-10/msg00074.html). Recommendations range from "doing
nothing" (takes a lot of disk space and slows down PostgreSQL) to
"`dbcheck` will fix this" (it didn't), neither of which worked in our
case.
Amazingly, the [solution](https://www.bacula.lat/delecao-de-clientes-e-backups-terminados-do-backup-do-bacula/?lang=en) is simply to call this command in
`bconsole`:
delete client=$FQDN-fd
For example:
delete archeotrichon.torproject.org-fd
This will remove all jobs related to the client, and then the client
itself. This is now part of the [host retirement procedure][].
TODO: You might still to run the `dbcheck.sql` script to clean related
resources, see [issue 40525](https://gitlab.torproject.org/tpo/tpa/team/-/issues/40525) for details
## Pager playbook
Hint: see also the [howto/postgresql](howto/postgresql) documentation for the backup