1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-12-03 09:59:53 +02:00

Revert "Replace BACKUP_PATH in the source files"

This reverts commit 90a4a4f4b3.
This commit is contained in:
Yura Sokolov 2024-05-16 14:08:04 +03:00
parent 28bc0f6358
commit f361dda7f3
9 changed files with 31 additions and 31 deletions

View File

@ -1146,7 +1146,7 @@ pg_probackup add-instance -B <replaceable>backup_dir</replaceable> -D <replaceab
<replaceable>backup_dir</replaceable> directory and at least read-only <replaceable>backup_dir</replaceable> directory and at least read-only
access to <replaceable>data_dir</replaceable> directory. If you access to <replaceable>data_dir</replaceable> directory. If you
specify the path to the backup catalog in the specify the path to the backup catalog in the
<envar>BACKUP_DIR</envar> environment variable, you can <envar>BACKUP_PATH</envar> environment variable, you can
omit the corresponding option when running <application>pg_probackup</application> omit the corresponding option when running <application>pg_probackup</application>
commands. commands.
</para> </para>
@ -5205,14 +5205,14 @@ pg_probackup catchup -b <replaceable>catchup_mode</replaceable>
<varlistentry> <varlistentry>
<term><option>-B <replaceable>directory</replaceable></option></term> <term><option>-B <replaceable>directory</replaceable></option></term>
<term><option>--backup-path=<replaceable>directory</replaceable></option></term> <term><option>--backup-path=<replaceable>directory</replaceable></option></term>
<term><envar>BACKUP_DIR</envar></term> <term><envar>BACKUP_PATH</envar></term>
<listitem> <listitem>
<para> <para>
Specifies the absolute path to the backup catalog. Backup Specifies the absolute path to the backup catalog. Backup
catalog is a directory where all backup files and meta catalog is a directory where all backup files and meta
information are stored. Since this option is required for most information are stored. Since this option is required for most
of the <application>pg_probackup</application> commands, you are recommended to specify of the <application>pg_probackup</application> commands, you are recommended to specify
it once in the <envar>BACKUP_DIR</envar> environment variable. In this case, it once in the <envar>BACKUP_PATH</envar> environment variable. In this case,
you do not need to use this option each time on the command you do not need to use this option each time on the command
line. line.
</para> </para>
@ -5672,7 +5672,7 @@ pg_probackup catchup -b <replaceable>catchup_mode</replaceable>
lazily, when the first log message is written. lazily, when the first log message is written.
</para> </para>
<para> <para>
Default: <filename>$BACKUP_DIR/log/</filename> Default: <filename>$BACKUP_PATH/log/</filename>
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -5755,7 +5755,7 @@ pg_probackup catchup -b <replaceable>catchup_mode</replaceable>
reached, the log file is rotated once a <application>pg_probackup</application> command reached, the log file is rotated once a <application>pg_probackup</application> command
is launched, except <command>help</command> and <command>version</command> commands. The time of the is launched, except <command>help</command> and <command>version</command> commands. The time of the
last log file creation is stored in last log file creation is stored in
<filename>$BACKUP_DIR/log/log_rotation</filename>. The zero value disables <filename>$BACKUP_PATH/log/log_rotation</filename>. The zero value disables
time-based rotation. Supported units: ms, s, min, h, d (min by time-based rotation. Supported units: ms, s, min, h, d (min by
default). default).
</para> </para>

View File

@ -811,7 +811,7 @@ msgstr ""
#: src/help.c:360 src/help.c:521 src/help.c:588 src/help.c:635 src/help.c:715 #: src/help.c:360 src/help.c:521 src/help.c:588 src/help.c:635 src/help.c:715
#: src/help.c:761 src/help.c:833 #: src/help.c:761 src/help.c:833
#, c-format #, c-format
msgid " directory for file logging (default: BACKUP_DIR/log)\n" msgid " directory for file logging (default: BACKUP_PATH/log)\n"
msgstr "" msgstr ""
#: src/help.c:361 src/help.c:522 src/help.c:589 src/help.c:636 src/help.c:716 #: src/help.c:361 src/help.c:522 src/help.c:589 src/help.c:636 src/help.c:716

View File

@ -113,7 +113,7 @@ static parray *setup_push_filelist(const char *archive_status_dir,
* set archive_command to * set archive_command to
* 'pg_probackup archive-push -B /home/anastasia/backup --wal-file-name %f', * 'pg_probackup archive-push -B /home/anastasia/backup --wal-file-name %f',
* to move backups into arclog_path. * to move backups into arclog_path.
* Where archlog_path is $BACKUP_DIR/wal/instance_name * Where archlog_path is $BACKUP_PATH/wal/instance_name
*/ */
void void
do_archive_push(InstanceState *instanceState, InstanceConfig *instance, char *pg_xlog_dir, do_archive_push(InstanceState *instanceState, InstanceConfig *instance, char *pg_xlog_dir,
@ -1126,7 +1126,7 @@ do_archive_get(InstanceState *instanceState, InstanceConfig *instance, const cha
join_path_components(absolute_wal_file_path, current_dir, wal_file_path); join_path_components(absolute_wal_file_path, current_dir, wal_file_path);
/* full filepath to WAL file in archive directory. /* full filepath to WAL file in archive directory.
* $BACKUP_DIR/wal/instance_name/000000010000000000000001 */ * $BACKUP_PATH/wal/instance_name/000000010000000000000001 */
join_path_components(backup_wal_file_path, instanceState->instance_wal_subdir_path, wal_file_name); join_path_components(backup_wal_file_path, instanceState->instance_wal_subdir_path, wal_file_name);
INSTR_TIME_SET_CURRENT(start_time); INSTR_TIME_SET_CURRENT(start_time);

View File

@ -1437,7 +1437,7 @@ get_multi_timeline_parent(parray *backup_list, parray *tli_list,
} }
/* /*
* Create backup directory in $BACKUP_DIR * Create backup directory in $BACKUP_PATH
* (with proposed backup->backup_id) * (with proposed backup->backup_id)
* and initialize this directory. * and initialize this directory.
* If creation of directory fails, then * If creation of directory fails, then

View File

@ -372,7 +372,7 @@ help_backup(void)
printf(_(" --error-log-filename=error-log-filename\n")); printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n")); printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n")); printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n")); printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n")); printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n")); printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n")); printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
@ -548,7 +548,7 @@ help_restore(void)
printf(_(" --error-log-filename=error-log-filename\n")); printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n")); printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n")); printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n")); printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n")); printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n")); printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n")); printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
@ -621,7 +621,7 @@ help_validate(void)
printf(_(" --error-log-filename=error-log-filename\n")); printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n")); printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n")); printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n")); printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n")); printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n")); printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n")); printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
@ -674,7 +674,7 @@ help_checkdb(void)
printf(_(" --error-log-filename=error-log-filename\n")); printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n")); printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n")); printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n")); printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n")); printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n")); printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n")); printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
@ -760,7 +760,7 @@ help_delete(void)
printf(_(" --error-log-filename=error-log-filename\n")); printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n")); printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n")); printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n")); printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n")); printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n")); printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n")); printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
@ -814,7 +814,7 @@ help_merge(void)
printf(_(" --error-log-filename=error-log-filename\n")); printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n")); printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n")); printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n")); printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n")); printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n")); printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n")); printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
@ -890,7 +890,7 @@ help_set_config(void)
printf(_(" --error-log-filename=error-log-filename\n")); printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n")); printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n")); printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n")); printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n")); printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n")); printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n")); printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
@ -1002,7 +1002,7 @@ help_add_instance(void)
printf(_(" --error-log-filename=error-log-filename\n")); printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n")); printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n")); printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n")); printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n")); printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n")); printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n")); printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
@ -1072,7 +1072,7 @@ help_archive_push(void)
printf(_(" --error-log-filename=error-log-filename\n")); printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n")); printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n")); printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n")); printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n")); printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n")); printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n")); printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
@ -1131,7 +1131,7 @@ help_archive_get(void)
printf(_(" --error-log-filename=error-log-filename\n")); printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n")); printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n")); printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n")); printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n")); printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n")); printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n")); printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
@ -1221,7 +1221,7 @@ help_catchup(void)
printf(_(" --error-log-filename=error-log-filename\n")); printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n")); printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n")); printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n")); printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n")); printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n")); printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n")); printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));

View File

@ -468,10 +468,10 @@ main(int argc, char *argv[])
if (backup_path == NULL) if (backup_path == NULL)
{ {
/* /*
* If command line argument is not set, try to read BACKUP_DIR * If command line argument is not set, try to read BACKUP_PATH
* from environment variable * from environment variable
*/ */
backup_path = getenv("BACKUP_DIR"); backup_path = getenv("BACKUP_PATH");
} }
if (backup_path != NULL) if (backup_path != NULL)
@ -498,7 +498,7 @@ main(int argc, char *argv[])
backup_subcmd != CATCHUP_CMD) backup_subcmd != CATCHUP_CMD)
elog(ERROR, elog(ERROR,
"No backup catalog path specified.\n" "No backup catalog path specified.\n"
"Please specify it either using environment variable BACKUP_DIR or\n" "Please specify it either using environment variable BACKUP_PATH or\n"
"command line option --backup-path (-B)"); "command line option --backup-path (-B)");
/* ===== catalogState (END) ======*/ /* ===== catalogState (END) ======*/

View File

@ -837,13 +837,13 @@ typedef struct InstanceState
CatalogState *catalog_state; CatalogState *catalog_state;
char instance_name[MAXPGPATH]; //previously global var instance_name char instance_name[MAXPGPATH]; //previously global var instance_name
/* $BACKUP_DIR/backups/instance_name */ /* $BACKUP_PATH/backups/instance_name */
char instance_backup_subdir_path[MAXPGPATH]; char instance_backup_subdir_path[MAXPGPATH];
/* $BACKUP_DIR/backups/instance_name/BACKUP_CATALOG_CONF_FILE */ /* $BACKUP_PATH/backups/instance_name/BACKUP_CATALOG_CONF_FILE */
char instance_config_path[MAXPGPATH]; char instance_config_path[MAXPGPATH];
/* $BACKUP_DIR/backups/instance_name */ /* $BACKUP_PATH/backups/instance_name */
char instance_wal_subdir_path[MAXPGPATH]; // previously global var arclog_path char instance_wal_subdir_path[MAXPGPATH]; // previously global var arclog_path
/* TODO: Make it more specific */ /* TODO: Make it more specific */

View File

@ -13,11 +13,11 @@
typedef struct CatalogState typedef struct CatalogState
{ {
/* $BACKUP_DIR */ /* $BACKUP_PATH */
char catalog_path[MAXPGPATH]; //previously global var backup_path char catalog_path[MAXPGPATH]; //previously global var backup_path
/* $BACKUP_DIR/backups */ /* $BACKUP_PATH/backups */
char backup_subdir_path[MAXPGPATH]; char backup_subdir_path[MAXPGPATH];
/* $BACKUP_DIR/wal */ /* $BACKUP_PATH/wal */
char wal_subdir_path[MAXPGPATH]; // previously global var arclog_path char wal_subdir_path[MAXPGPATH]; // previously global var arclog_path
} CatalogState; } CatalogState;

View File

@ -25,7 +25,7 @@ class OptionTest(ProbackupTest, unittest.TestCase):
except ProbackupException as e: except ProbackupException as e:
self.assertIn( self.assertIn(
'ERROR: No backup catalog path specified.\n' + \ 'ERROR: No backup catalog path specified.\n' + \
'Please specify it either using environment variable BACKUP_DIR or\n' + \ 'Please specify it either using environment variable BACKUP_PATH or\n' + \
'command line option --backup-path (-B)', 'command line option --backup-path (-B)',
e.message, e.message,
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(repr(e.message), self.cmd)) '\n Unexpected Error Message: {0}\n CMD: {1}'.format(repr(e.message), self.cmd))