diff --git a/repmgr-action-standby.c b/repmgr-action-standby.c index 54615412..651264fd 100644 --- a/repmgr-action-standby.c +++ b/repmgr-action-standby.c @@ -670,6 +670,15 @@ do_standby_clone(void) log_hint(_("consider using the -c/--fast-checkpoint option")); } + if (mode == pg_basebackup) + { + /* + * In --dry-run mode, this will just output the pg_basebackup command which + * would be executed. + */ + run_basebackup(&local_node_record); + } + PQfinish(source_conn); log_info(_("all prerequisites for \"standby clone\" are met")); @@ -6776,6 +6785,13 @@ run_basebackup(t_node_info *node_record) termPQExpBuffer(¶ms); + if (runtime_options.dry_run == true) + { + log_info(_("would execute:\n %s"), script.data); + termPQExpBuffer(&script); + return SUCCESS; + } + log_info(_("executing:\n %s"), script.data); /*