Versions

Shows backup versions.

$ hb versions [-c backupdir] [-r version] or [-a]

With no options, displays versions still containing user files or arc files.

Options

The -r option shows a specific version.

The -a option shows all versions.

Example

This is an excerpt of versions -a for the HashBackup development server backup:

$ hb versions -c /hbbackup -a
HashBackup #2964 Copyright 2009-2022 HashBackup, LLC
Backup directory: /hbbackup
Showing all versions

Version | Owner  |     Backup Start    |      Backup End     |     Time    | Files  |  File, Backup Space |  HB #
--------+--------+---------------------+---------------------+-------------+--------+---------------------+------
  3759  | 0 root | 2022-05-02 23:01:56 | 2022-05-02 23:16:34 |   14m 38s   |  259   |     24 GB    126 MB |  2956
  3760  | 0 root | 2022-05-03 23:01:12 | 2022-05-03 23:19:57 |   18m 45s   |  254   |     24 GB     83 MB |  2960
  3761  | 0 root | 2022-05-04 22:00:58 | 2022-05-04 22:14:35 |   13m 37s   |  260   |     24 GB     88 MB |  2960
  3762  | 0 root | 2022-05-05 22:01:23 | 2022-05-05 22:16:33 |   15m 10s   |  181   |     23 GB     11 MB |  2962
  3763  | 0 root | 2022-05-06 22:00:13 | 2022-05-06 22:13:50 |   13m 37s   |  276   |     24 GB     87 MB |  2962

This backup shows a huge amount of deduplication (24GB saved in 87MB) because most of the data is VM images that are used to build versions of HashBackup on different operating systems.

Details

Version information is shown in several columns:

The first 5 columns, Version, Owner, Backup Start, Backup End, and Time are easy to understand.

The Files column is the number of files saved in the version that are still in the backup. Files are removed with the rm or retain commands, so this number changes over time.

File, Backup Space has 2 columns. File, is the sum of the files sizes, as shown by a Unix ls command, for files still saved in the version.

Backup Space is the backup space used by arc files in a version. This number can be very confusing! For example, here is versions -a for the HashBackup development server:

HashBackup #2964 Copyright 2009-2022 HashBackup, LLC
Backup directory: /hbbackup
Showing all versions

Version | Owner  |     Backup Start    |      Backup End     |     Time    | Files  |  File, Backup Space |  HB #
--------+--------+---------------------+---------------------+-------------+--------+---------------------+------
   0    | 0 root | 2010-10-10 15:38:35 | 2010-10-10 16:30:21 |   51m 45s   |        |              8.4 GB |
   1    | 0 root | 2010-10-10 17:04:01 | 2010-10-10 17:13:03 |    9m  2s   |        |                     |
   2    | 0 root | 2010-11-26 23:52:30 | 2010-11-27 00:47:40 |   55m  9s   |        |              3.6 GB |
 ...

In version 0 there are no files in the Files column: the files that were originally saved in back in 2010 have been superceeded by later versions, perhaps by using the --full option on a later backup. But there is 8.4 GB of data stored in arc files named arc.0.N, because later backups are still using this data (blocks) from the initial backup, even though the file history of where those blocks came from has been removed. Version 2 is similar.

A second confusing aspect of the backup space column relates to arc file packing. With each backup, data saved supersedes data in earlier backups, so older arc files develop "holes": the original data is still there, but it is no longer needed. When this happens enough in an individual arc file, that file is packed by retain (or rm). During packing the active blocks are kept and the inactive blocks are removed, shrinking the arc file.

Packing can happen for a consecutive group of arc files in different versions. Instead of packing each version separately, HashBackup may pack and combine a series of arc files into one larger arc file for efficiency. Since an arc file can only belong to one version, this leads to the version -a output below, also from the HashBackup server backup:

  3728  | 0 root | 2022-03-25 00:00:13 | 2022-03-25 00:13:56 |   13m 43s   |  112   |     28 MB     65 MB |  2775
  3729  | 0 root | 2022-03-26 00:00:12 | 2022-03-26 00:13:53 |   13m 41s   |  114   |                     |  2775
  3730  | 0 root | 2022-03-27 00:00:13 | 2022-03-27 00:13:51 |   13m 38s   |  115   |     28 MB    157 MB |  2775
  3731  | 0 root | 2022-03-28 00:03:20 | 2022-03-28 00:15:59 |   12m 39s   |  114   |                     |  2864
  3732  | 0 root | 2022-03-29 00:00:13 | 2022-03-29 00:13:38 |   13m 25s   |  110   |                     |  2865
  3733  | 0 root | 2022-03-30 00:00:12 | 2022-03-30 00:13:30 |   13m 18s   |  117   |                     |  2868
  3734  | 0 root | 2022-04-01 00:00:14 | 2022-04-01 00:14:19 |   14m  5s   |  384   |    1.9 GB    126 MB |  2871
  3735  | 0 root | 2022-04-02 00:00:13 | 2022-04-02 00:13:34 |   13m 21s   |  133   |     34 MB     28 MB |  2874
  3736  | 0 root | 2022-04-03 00:00:13 | 2022-04-03 00:13:41 |   13m 28s   |  125   |     33 MB     84 MB |  2876

It’s confusing that version 3730 says it is storing only 28MB of data in files (this is before deduplication or compression), and yet it is using 65MB of backup space. The clue is the 3 blank lines that follow: the data from those backups has been packed into the version 3730 backup. This can be seen in the HashBackup log files for retain:

2022-05-02 Mon 02:24:00| Packing archives
2022-05-02 Mon 02:24:00| Packing arc.3730.0 into arc.3730.1
2022-05-02 Mon 02:24:02| Packing arc.3731.0 into arc.3730.1
2022-05-02 Mon 02:24:05| Packing arc.3732.0 into arc.3730.1
2022-05-02 Mon 02:24:08| Packing arc.3733.0 into arc.3730.1
2022-05-02 Mon 02:24:12| Packing arc.3725.0 into arc.3725.1
2022-05-02 Mon 02:24:15| Packing arc.3726.0 into arc.3725.1
2022-05-02 Mon 02:24:17| Packing arc.3727.0 into arc.3725.1

The data in versions 3731, 3732 and 3733 has all been moved into arc.3730.1, making these version appear empty while version 3730 gets larger.

So immediately following a backup, the numbers describing space will "make sense", but as time goes on and files are removed by retain and arc files are packed and combined, there is less of a direct relationship between File space and Backup Space.