[Borgbackup] What are host and user name in archives used for?

Thomas Waldmann tw at waldmann-edv.de
Fri Jul 9 06:07:51 EDT 2021


> from my understanding of Borg, in Borg itself I only have two levels
> to organize my backups: The repo itself and multiple archives within.

Yup. Just wanted to add that "multiple archives within" has at least 2 
sub cases:

1. multiple historical backups of same data set at different points in 
time, forming a sequence of archives that belong together

2. multiple backups of different data sets (from one machine, e.g. 
system vs. homes, from multiple machines, etc.) - each of them usually 
forming its own historical sequence.

This is all mapped into the archive name, usually like
{hostname}-{datasetname}-{timestamp} and has to be considered for 
--prefix option, esp. for borg prune.

> It's not clear to me currently if it's really only about a naming
> convention

Yes, currently there is no additional intelligence. Just archive names 
and helpers like placeholders to create nice names and stuff like 
--prefix to limit to a subset of all names.

> Additionally there's the env variable "BORG_HOST_ID" mentioning some
> automatically done calculations.

If you have different hostnames, I guess you do not need to use that.
It's just to have some unique ID, if you otherwise don't.

> In the end, it's about e.g. pruning old archives, which provides the
> argument "--prefix". From my understandig this really only applies to
> the name of the archive,

Yes.

> so I need to encode things like different
> backed up hosts, purposes etc. really only there or afterwards I won't
> be able to distinguish things when pruning anymore. E.g. when only
> using generic names with timestamps, I wouldn't be able to prune
> VM-contents more often than other backup purposes.

Yes, that is exactly why you need --prefix and a sane naming convention.

> Or are there mechanisms that e.g. additionally filter by fields
> "hostname", "username" etc. maintained by the archive itself? Maybe
> only some commands do so and prune does not?

IIRC we do not really use that metadata except keeping and displaying it.


-- 
GPG ID: 9F88FB52FAF7B393
GPG FP: 6D5B EF9A DD20 7580 5747 B70F 9F88 FB52 FAF7 B393


More information about the Borgbackup mailing list