INIT v2.6
The INIT
subcommand is used to create the BART backup catalog directory, rebuild the BART backupinfo
file, and set the archive_command
in the server based on the archive_command
setting in the bart.cfg
file.
Syntax:
The following table describes the INIT
options:
Options | Description |
---|---|
-s { <server_name> | all } --server { <server_name> | all } | <server_name> is the name of the database server to which the INIT actions are to be applied. If all is specified or if the option is omitted, actions are applied to all servers. |
-o --override | Overrides the existing Postgres archive_command configuration parameter setting in the postgresql.conf file or the postgresql.auto.conf file using the BART archive_command parameter in the BART configuration file. The INIT generated archive command string is written to the postgresql.auto.conf file. |
-r --rebuild | Rebuilds the backupinfo file located in each backup subdirectory. If all is specified or if the option is omitted, the backupinfo files of all backups for the database servers specified by the -s option are recreated. This option is only intended for recovering from a situation where the backupinfo file has become corrupt.If the backup was initially created with a user-defined backup name, and then the INIT -r option is invoked to rebuild that backupinfo file, the user-defined backup name is no longer available. Thus, future references to the backup must use the backup identifier. |
-i { <backup_id> | <backup_name> | all } --backupid { <backup_id> | <backup_name> | all } | <backup_id> is an integer, backup identifier and <backup_name> is the user-defined alphanumeric name for the backup. The -i option can only be used with the -r option. |
--no-configure | Prevents the archive_command from being set in the PostgreSQL server. |
Examples
In the following code sample, you can see that archive_mode = off
and archive_command
is not set. After invoking the BART INIT
subcommand, archive_mode
is set to on
and archive_command
is set:
In the following code sample, you can see that archive_mode = on
, and archive_command
is not set. After invoking the INIT
subcommand, archive_command
is set:
In the following code sample, you can see that archive_mode = on
and archive_command
are already set. After invoking the INIT
subcommand, there is no change in their settings. Note that to override the existing archive_command
, you must include the -o
option.
In the following code sample, you can see that archive_mode = off
and archive_command
is already set. After invoking the INIT
subcommand archive_mode
is set to on
:
In the following code sample an existing archive command
setting is overridden by resetting the archive_command
in the PostgreSQL server with the archive_command = 'cp %p %a/%f'
parameter from the bart.cfg
file:
The archive_mode
and archive_command
parameters in the database server are set as follows:
Invoke the INIT
subcommand with the -o
option to override the current archive_command
setting in the PostgreSQL server:
Reload the database server configuration; a restart of the database server is not necessary to reset only the archive_command
parameter:
The archive_command
in the PostgreSQL server is now set as follows:
The new command string is written to the postgresql.auto.conf
file:
When you invoke the BART INIT
command with the -r
option, BART rebuilds the backupinfo
file using the content of the backup directory for the server specified or for all servers. The BART backupinfo
file 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 is invoked to rebuild the backupinfo
file, the user-defined backup name is no longer available. Thus, future references to the backup must use the backup identifier.
The following code sample shows the backupinfo
file location in a backup subdirectory:
The following code sample displays the backupinfo
file content:
The following code sample displays an error message if the backupinfo
file is missing when invoking a BART subcommand:
The backupinfo
file may be missing if the BACKUP
subcommand did not complete successfully.
The following code sample displays information about rebuilding the backupinfo
file of the specified backup for database server acctg
:
The following code sample displays information about how the backupinfo
files of all backups are rebuilt for all database servers:
The following code sample displays information about invoking BART INIT
with the -r - i
option:
The following code sample displays information about invoking the BART INIT
command with the --no-configure
option. You can use the --no-configure
option with the INIT
subcommand to prevent the archive_command
option from being set in the PostgreSQL server.