The INIT subcommand may be invoked to perform the following actions:
•
|
Set the archive_command in the PostgreSQL server based on the archive_command setting in the bart.cfg file.
|
Note: Do not invoke the
INIT subcommand while the BART
BACKUP subcommand is in progress. Backups affected by the backup process will be ignored by the
INIT subcommand.
|
|
|
|
|
|
|
|
|
Rebuilds the backupinfo file for the specified backup. The -i option can be used with the -r option only.
|
|
Prevents the archive_command from being set in the PostgreSQL server.
|
|
|
As described in the above table, when you invoke the BART INIT subcommand,
the BART backup catalog directory is created (if it does not exist already) and the
archive_command is set in the PostgreSQL server. After the
archive_command is set, you need to either restart the PostgreSQL server or reload the configuration in the PostgreSQL server based on the following scenarios. For examples, see BART INIT examples section.
Scenario 1 - If the
archive_mode is set to off and
archive_command is not set in the PostgreSQL server, the
archive_command is set based on the
archive_command setting in the
bart.cfg and also sets the
archive_mode to on. In this case, you need to restart the PostgreSQL server using
'pg_ctl restart'
Scenario 2 – I
f the
archive_mode is set to on and
archive_command is not set in the PostgreSQL server, the
archive_command is set based on the
archive_command setting in the
bart.cfg. In this case, you need to reload the configuration in the PostgreSQL server using
pg_reload_conf() or
'pg_ctl reload'
Scenario 3 – If the
archive_mode is set to off and
archive_command is already set in the PostgreSQL server, the
archive_mode is set to on. In this case, you need to restart the PostgreSQL server using
'pg_ctl restart'
Scenario 4 - I
f the archive_mode is set to on and
archive_command is already set in the PostgreSQL server, then the
archive_command is not set unless
-o option is specified.
Example 1 – In this following example when you invoke
BART INIT subcommand with
archive_mode = off and archive_command not set,
archive_mode is set to on and
archive_command will be set.
Example 2 -
BART INIT with
archive_mode = on and archive_command not set
Example 3 -
BART INIT with
archive_mode = on and
archive_command already set
Note: To override the existing
archive_command, use the -
o option.
Example 4 -
BART INIT with
archive_mode = off and
archive_command already set
The archive_mode and
archive_command parameters in the database server are set as follows:
The INIT subcommand is invoked with the
-o option to override the current
archive_command setting in the PostgreSQL server.
The archive_command in the PostgreSQL server is now set as follows:
When you invoke the BART INIT command with the
-r option, it rebuilds the
backupinfo file using the content of the backup directory for the server specified by the
-s option, or for all servers if
-s all is specified or the
-s option is omitted. The BART
backupinfo file (named
backupinfo) is initially created by the
BACKUP subcommand and contains the backup information used by BART.
Note: If the backup was initially created with a user-defined backup name, and then the
INIT -r option rebuilds that
backupinfo file, the user-defined backup name is no longer available. Thus, future references to the backup must use the backup identifier.
The backupinfo file content is as follows:
If the backupinfo file is missing, then the following error message appears when a BART subcommand is invoked:
The backupinfo file could be missing if the
BACKUP subcommand did not complete successfully.
backup_id is a backup identifier.
backup_name is the user-defined alphanumeric name for the backup.