Table of Contents Previous Next



3.4.2 INIT
The INIT subcommand may be invoked to perform the following actions:
Rebuild the BART backupinfo file.
Set the archive_command in the PostgreSQL server based on the archive_command setting in the bart.cfg file.
bart INIT [ –s { server_name | all } ] [ -o ]
[ -r [ -i { backup_id | backup_name | all } ] ]
bart INIT [ –s { server_name | all } ] [ -o ][-- no configure]
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.
The following table summarizes the actions performed by INIT subcommand for the server specified by the -s option, or for all servers if -s all is specified or the -s option is omitted. See BART INIT examples section for examples of each option.
Creates the BART backup catalog directory always (if it does not exist already). It also sets the archive_command in the PostgreSQL server (if it has not been set already) based on the archive_command setting in the bart.cfg. See BART INIT section for details.
Overrides the archive_command setting in the PostgreSQL server if archive_mode is on and archive_command is already set.
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 – 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 sconfiguration 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 - 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.
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
Example 5 - BART INIT –o
The following example overrides an existing archive command setting by resetting the archive_command in the PostgreSQL server from the archive_command = 'cp %p %a/%f' parameter in the bart.cfg file.
The following is the bart.cfg file:
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:
Example 6 - BART INIT-r
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 following example shows the backupinfo file location in a backup subdirectory:
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.
The following example rebuilds the backupinfo file of the specified backup for database server acctg.
The following example shows how the backupinfo files of all backups are rebuilt for all database servers.
Example 7 - BART INIT –r -i
bart INIT [ -r [ -i { backup_id | backup_name | all } ]
backup_id is a backup identifier. backup_name is the user-defined alphanumeric name for the backup.
Example 8 - BART INIT –-no configure
[edb@localhost bin]$


Table of Contents Previous Next