ybbackup-list Command

The ybbackup-list command returns one or more chains of backups that are stored in a specific backup location.
ybbackup-list --dirs <path> [ --name <name> ] [ --cleanup ] [ options ]

You must provide the location with the --dirs option. The name of the chain (--name) is optional.

The --cleanup option provides a way to remove failed (partial) backups from a storage location (in order to reclaim space).

You do not need to connect to the database to run this command, so do not try to set the user and password options that are required for ybbackup and ybrestore commands. Any user can run the ybbackup-list command.

An alternative way to look at your backup history is to query the sys.log_backup view.

The ybbackup-list command supports several other options:
  • -?, --help
  • --java-version
  • --log-level, --logfile, --logfile-log-level
  • -q, --quiet
  • --version
See ybbackup Options for details.
The output of this command contains several pieces of information that are useful for restore operations:
  • Restore point: a number from 0 to n
  • Restore point in time: a complete timestamp
  • The name of the backup chain
  • Whether the backup contains data (or just metadata)
  • The name of the database. Each database that is backed up independently has its own entry for each successful backup that you run (that is, its own point number in the backup chain)
Note: The first backup of a database into a chain is marked as a FULL backup. Subsequent backups of the same database into the same chain are marked as INCREMENTAL. A database that has been dropped, then re-created or restored, will have its next backup marked as FULL.

Example: List Chains of Backups

Return a list of backups that have been taken in a specific backup location. In this case, two different chains are present:
$ ybbackup-list --dirs /home/yb100/backup_all 
17:22:42.395 [ INFO] ABOUT CLIENT:
    app.cli_args         = --dirs /home/yb100/backup_all
    app.name_and_version = Yellowbrick Backup and Restore version 2.0.0-10859
    java.home            = /usr/lib/jvm/java-8-oracle/jre
    java.version         = 1.8.0_101
    jvm.memory           = 512.00 MB (max=4.00 GB)
    jvm.name_and_version = Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
    jvm.options          = -Xms512m, -Xmx4g, -XX:+UseG1GC, -Dapp.name=ybbackup-list, -Dapp.pid=23673, -Dapp.repo=/usr/lib/ybtools/lib, -Dapp.home=/usr/lib/ybtools, -Dbasedir=/usr/lib/ybtools
    jvm.vendor           = Oracle Corporation
    os.name_and_version  = Linux 4.4.0-31-generic (amd64)

Listing chain: feb15
     0 2019-02-16T01:20:53.346Z         FULL DATABASE       408035 feb15 has data premdb 
     1 2019-02-16T01:21:02.589Z         FULL DATABASE       408105 feb15 has data yellowbrick 

Listing chain: feb15all
     0 2019-02-16T01:22:17.090Z         FULL DATABASE       408220 feb15all has data premdb 
     1 2019-02-16T01:22:26.133Z         FULL DATABASE       408291 feb15all has data yellowbrick 

Example: Remove Partial Backups

Use the --cleanup option to remove partial backups from a given chain and reclaim space. In this context, a partial backup is any backup that failed at some point in the ybbackup operation.

For example:
$ ybbackup-list --cleanup --dirs /home/yb100/yb100_backups
14:36:20.489 [ INFO] ABOUT CLIENT:
...
Cleaning partial backups from chain: nov13
Cleanup complete.
Cleaning partial backups from chain: nov13v2
Cleanup complete.
Cleaning partial backups from chain: nov14
Cleanup complete.
In this case, a partial backup was found and deleted:
$ ybbackup-list --cleanup --dirs /home/yb100/backups --name feb02
...
Cleaning partial backups from chain: feb02
13:00:04.939 [ INFO] Deleting partial backup point: 0, tx: 4009, date: 2018-02-02T20:59:39.426Z
13:00:04.970 [ INFO] Freed 144.23 MB
Cleanup complete.

Example: Add a Description to a Backup

You can use the --description option in the ybbackup command to save information about a backup that is reported by the ybbackup-list command:
$ ybbackup -d premdb --dirs /home/brumsby/yb100_backups --name nov15 -W --description 'November 15th backup of premdb'
Password for user yb100: 
...
$ ybbackup-list --dirs /home/brumsby/yb100_backups --name nov15
14:40:36.347 [ INFO] Yellowbrick Backup and Restore version 2.0.0-9378
...
Listing chain: nov15
     0 2018-11-15T22:39:38.549Z         FULL DATABASE        55764 nov15 has data premdb November 15th backup of premdb