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 PostgreSQL server based on the archive_command setting in the bart.cfg file.

Note

If the archive_mode configuration parameter is set to off, then the -o option must be used to set the Postgres archive_command using the BART archive_command parameter in the BART configuration file even if the archive_command is not currently set in postgresql.conf nor in postgresql.auto.conf file.

Syntax:

bart INIT [ –s { <server_name> | all } ] [ -o ]
  [ -r [ -i { <backup_id> | <backup_name> | all } ] ]
  [--no-configure]

All subcommand options are generally specified in lowercase. The following table describes the command options:

OptionsDescription
-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, the actions are applied to all servers.
-o

--override
Overrides the existing, active 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 (a text file named backupinfo) located in each backup subdirectory. 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. 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. The -i option can only be used with the -r option.
--no-configurePrevents the archive_command from being set in the PostgreSQL server.

Archive Command Setting

After the archive_command is set, you need to either restart the PostgreSQL server or reload the configuration file in the PostgreSQL server based on the following conditions.

  • 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
  • If 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.
  • 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
  • If 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.