Skip to content

Commit

Permalink
repo-list: add hostname and username to default format, reorder, adjust
Browse files Browse the repository at this point in the history
borg 1.x encouraged users to put everything into the archive name:
- name of the dataset
- timestamp (usually used to make the archive name unique)
- maybe also hostname (when backing up to same repo from multiple hosts)
- maybe also username (when backing up to same repo from multiple users)

borg2 now discourages users from putting the timestamp into the name,
because we rather want same name within a series of archives - thus,
the field width for the name can be narrower.

the ID of the archive is now the only unique identifier, thus it is
moved to the leftmost place.

the ID is followed by the timestamp (also quite "interesting", because
it usually differs for different archives).

then following are: archive name, user name, host name - these might be
always the same if there is only one series of archives in a repo.

use 2 blanks separating the fields for better readability.
  • Loading branch information
ThomasWaldmann committed Sep 26, 2024
1 parent 7acedec commit ca9eb74
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/borg/archiver/repo_list_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ def do_repo_list(self, args, repository, manifest):
elif args.short:
format = "{id}{NL}"
else:
format = os.environ.get("BORG_RLIST_FORMAT", "{archive:<36} {time} [{id32}]{NL}")
format = os.environ.get(
"BORG_RLIST_FORMAT", "{id32} {time} {archive:<15} {username:<10} {hostname:<10}{NL}"
)
formatter = ArchiveFormatter(format, repository, manifest, manifest.key, iec=args.iec)

output_data = []
Expand Down

0 comments on commit ca9eb74

Please sign in to comment.