Removing a backup file from the listing

You can remove a backup file from the list of backup files available for downloading for restore.

Procedure

  1. List the available Backup Files on the sftp server:
    $ /sftp/backup.sh -L -H $HOST -u $USERNAME -k /sshd/sftp-key -d $DIRECTORY
    drwxr-xr-x    2 root     root          118 Aug 26 12:04 .
    drwxrwxrwt   10 root     root          198 Aug 26 09:45 ..
    -rw-r--r--    1 root     root     13092333 Aug 26 08:56 20200826-154646F.tgz
    -rw-r--r--    1 root     root     18703758 Aug 26 09:10 20200826-160010F.tgz
    -rw-r--r--    1 root     root     24318561 Aug 26 09:21 20200826-161301F.tgz
    -rw-r--r--    1 root     root     34315393 Aug 26 12:04 20200826-162422F.tgz

    The last full backup is 20200826-162422F. In this example, we will remove this file from the valid backup list.

  2. Choose and download 20200826-161301F.tgz from the available backup files on the sftp server.

    Note that this backup file does not include 20200826-162422F, which is the one to be removed:

    $ /sftp/backup.sh -D -H $HOST -u $USERNAME -k /sshd/sftp-key -d $DIRECTORY -n 20200826-161301F.tgz
    Starting download of backup 20200826-161301F.tgz using protocol sftp
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 23.1M  100 23.1M    0     0  15.9M      0  0:00:01  0:00:01 --:--:-- 15.9M
    100 23.1M  100 23.1M    0     0  15.9M      0  0:00:01  0:00:01 --:--:-- 15.9M
    Successful download

    The contents of the /backrestrepo directory in the Backup and Restore Pod will now be replaced with the contents of the 20200826-161301F.tgz backup file.

  3. Run pgbackrest info within the Backup and Restore Pod to show the backups:
    $ pgbackrest info
    stanza: db
        status: ok
        cipher: none
    
        db (current)
            wal archive min/max (12-1): 000000010000000000000001/000000040000000000000012
    
            full backup: 20200826-152658F
                timestamp start/stop: 2020-08-26 15:26:58 / 2020-08-26 15:27:23
                wal start/stop: 000000010000000000000002 / 000000010000000000000002
                database size: 31MB, backup size: 31MB
                repository size: 3.7MB, repository backup size: 3.7MB
    
            full backup: 20200826-154646F
                timestamp start/stop: 2020-08-26 15:46:46 / 2020-08-26 15:47:11
                wal start/stop: 000000020000000000000006 / 000000020000000000000006
                database size: 31MB, backup size: 31MB
                repository size: 3.7MB, repository backup size: 3.7MB
    
            full backup: 20200826-160010F
                timestamp start/stop: 2020-08-26 16:00:10 / 2020-08-26 16:00:36
                wal start/stop: 000000030000000000000009 / 000000030000000000000009
                database size: 31MB, backup size: 31MB
                repository size: 3.7MB, repository backup size: 3.7MB
    
            full backup: 20200826-161301F
                timestamp start/stop: 2020-08-26 16:13:01 / 2020-08-26 16:13:29
                wal start/stop: 00000004000000000000000C / 00000004000000000000000C
                database size: 31MB, backup size: 31MB
                repository size: 3.7MB, repository backup size: 3.7MB

    Backup 20200826-162422F is no longer an option for restoration.

    A ManagementRestore custom resource can now be created to perform a Restore to any of these backups. For more information, see Restoring the management subsystem (10.0.1.1-eus or later).