From ca9eb74dd9d755a303b1266322ac22bc7f805f29 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Thu, 26 Sep 2024 10:06:53 +0200 Subject: [PATCH] repo-list: add hostname and username to default format, reorder, adjust 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. --- src/borg/archiver/repo_list_cmd.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/borg/archiver/repo_list_cmd.py b/src/borg/archiver/repo_list_cmd.py index 1a66a5e54b..5f7693e5e9 100644 --- a/src/borg/archiver/repo_list_cmd.py +++ b/src/borg/archiver/repo_list_cmd.py @@ -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 = []