バージョンごとのドキュメント一覧

F.5. basebackup_to_shell — pg_basebackupモジュール"shell"の例 #

<title>basebackup_to_shell &mdash; example "shell" pg_basebackup module</title>

<filename>basebackup_to_shell</filename> adds a custom basebackup target called <literal>shell</literal>. This makes it possible to run <command>pg_basebackup &#45;-target=shell</command> or, depending on how this module is configured, <command>pg_basebackup &#45;-target=shell:<replaceable>DETAIL_STRING</replaceable></command>, and cause a server command chosen by the server administrator to be executed for each tar archive generated by the backup process. The command will receive the contents of the archive via standard input. basebackup_to_shellは、shellという名前のカスタムbasebackupターゲットを追加します。 これにより、pg_basebackup --target=shellを実行するか、このモジュールの設定方法に応じてpg_basebackup --target=shell:DETAIL_STRINGを実行し、サーバ管理者が選択したサーバコマンドを、バックアッププロセスで生成されたtarアーカイブごとに実行させることができます。 コマンドは、標準入力を介してアーカイブの内容を受け取ります。

This module is primarily intended as an example of how to create a new backup targets via an extension module, but in some scenarios it may be useful for its own sake. In order to function, this module must be loaded via <xref linkend="guc-shared-preload-libraries"/> or <xref linkend="guc-local-preload-libraries"/>. このモジュールは主に、拡張モジュールを使用して新しいバックアップ・ターゲットを作成する方法の例として作成されていますが、シナリオによってはそれ自体が役立つ場合があります。 このモジュールを機能させるには、shared_preload_librariesまたはlocal_preload_librariesを使用してロードする必要があります。

F.5.1. 設定パラメータ #

<title>Configuration Parameters</title>
basebackup_to_shell.command (string)

The command which the server should execute for each archive generated by the backup process. If <literal>%f</literal> occurs in the command string, it will be replaced by the name of the archive (e.g. <literal>base.tar</literal>). If <literal>%d</literal> occurs in the command string, it will be replaced by the target detail provided by the user. A target detail is required if <literal>%d</literal> is used in the command string, and prohibited otherwise. For security reasons, it may contain only alphanumeric characters. If <literal>%%</literal> occurs in the command string, it will be replaced by a single <literal>%</literal>. If <literal>%</literal> occurs in the command string followed by any other character or at the end of the string, an error occurs. バックアップ処理によって生成された各アーカイブに対してサーバが実行する必要があるコマンドです。 コマンド文字列に%fが含まれている場合は、アーカイブの名前に置き換えられます(例:base.tar)。 コマンド文字列に%dが含まれている場合は、ユーザーが指定したターゲット詳細に置き換えられます。 コマンド文字列に%dが使用されている場合は、ターゲット詳細が必要です。 それ以外の場合は禁止されています。 セキュリティ上の理由から、ターゲット詳細には英数字のみを使用できます。 %%がコマンド文字列に含まれている場合は、単一の%に置き換えられます。 %がコマンド文字列に含まれていて、その後に他の文字または文字列の末尾にある場合は、エラーが発生します。

basebackup_to_shell.required_role (string)

The role required in order to make use of the <literal>shell</literal> backup target. If this is not set, any replication user may make use of the <literal>shell</literal> backup target. shellバックアップターゲットを使用するために必要なロールです。 これが設定されていない場合、レプリケーションユーザーはshellバックアップターゲットを使用できます。

F.5.2. 作者 #

<title>Author</title>

Robert Haas