Table of Contents Previous Next



5.4.2 INIT
The INIT subcommand creates the BART backup catalog directory. INIT sets the Postgres archive_command configuration parameter based upon the setting of the BART archive_command parameter in the server section of the BART configuration file. The INIT subcommand also rebuilds the BART backupinfo file.
bart INIT [ –s { server_name | all } ] [ -o ]
[ -r [ -i { backup_id | backup_name | all } ] ]
Note: Do not invoke the INIT subcommand while the BART BACKUP subcommand is in progress. Backups affected by the backup process will be skipped and ignored by the INIT subcommand.
When the INIT subcommand is invoked, several different actions may be performed simultaneously. The following summarizes the actions performed under certain conditions and options.
When the INIT subcommand is invoked, the following action is always performed:
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 backup catalog directory structure is completed down to the archived_wals subdirectory if it does not already exist.
When the INIT subcommand is invoked without the -r option, the following action is always performed:
For the server specified by the -s option, or for all servers if -s all is specified or the -s option is omitted, an attempt is made to set the Postgres archive_command configuration parameter. If the archive_command parameter is already set (in other words, archive_command is set to a command string in either the postgresql.conf file or the postgresql.auto.conf file), then the existing archive_command setting is not replaced with the BART archive_command setting unless the -o option is specified as well. See Section 4.2.3.2 for additional information.
When the INIT subcommand is invoked with the -r option, the following action is always performed:
For the server specified by the -s option, or for all servers if -s all is specified or the -s option is omitted, the backupinfo file is recreated for all backups. If the -i option is included, then the backupinfo file is recreated for the specified backup.
The BART backupinfo file named backupinfo is initially created by the BACKUP subcommand and contains the backup information used by BART.
When INIT -r is invoked, BART rebuilds the backupinfo file using the content of the backup directory.
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 integer backup identifier.
The backupinfo file could be missing if the BACKUP subcommand did not complete successfully.
-s, --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
Override 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. 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.
-r, --rebuild
Rebuilds the backupinfo file. This file is a text file named backupinfo located in each backup subdirectory.
-i, --backupid { backup_id | backup_name | all }
backup_id is an integer, backup identifier. 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.
The following example completes the BART backup catalog directory and sets the Postgres archive_command using the default BART archive command format of scp %p %h:%a/%f. The default BART archive command format is used when the BART archive_command parameter is not explicitly included or assigned a command string within the server section of the BART configuration file.
The archive_mode and archive_command parameters in the database server are set as follows:
The INIT subcommand is invoked. The -o option is not necessary since archive_mode is on and archive_command is not set.
The Postgres archive_command is now set as follows:
The following example overrides an existing, active, archive command by resetting the Postgres archive_command parameter from the BART archive_command = 'cp %p %a/%f' parameter in the BART configuration 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 Postgres archive_command setting.
The Postgres archive_command is now set as follows:


Table of Contents Previous Next