-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasebackup-to-shell.html
More file actions
75 lines (75 loc) · 9.85 KB
/
basebackup-to-shell.html
File metadata and controls
75 lines (75 loc) · 9.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>F.4. basebackup_to_shell — pg_basebackupモジュール"shell"の例</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="auto-explain.html" title="F.3. auto_explain — 低速な問い合わせ実行計画のログ" /><link rel="next" href="basic-archive.html" title="F.5. basic_archive — WALアーカイブモジュールの例" /><meta name="viewport" content="width=device-width,initial-scale=1.0" /></head><body id="docContent" class="container-fluid col-10"><div class="other_version"><a href="https://www.postgresql.jp/document/">バージョンごとのドキュメント一覧</a></div><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="4" align="center"><a accesskey="h" href="index.html">PostgreSQL 18.3文書</a></th></tr><tr><td width="10%" align="left"></td><td width="10%" align="left"></td><td width="60%" align="center"><a href="contrib.html" title="付録F 追加で提供されるモジュールと拡張">付録F 追加で提供されるモジュールと拡張</a></td><td width="20%" align="right"><div class="actions"><a class="issue" title="github" href="https://github.com/pgsql-jp/jpug-doc/issues/new?template=bug_report.yml&what-happened=version 18.3 : basebackup-to-shell.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="auto-explain.html" title="F.3. auto_explain — 低速な問い合わせ実行計画のログ">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="contrib.html" title="付録F 追加で提供されるモジュールと拡張">上へ</a></td><td width="60%" align="center">F.4. basebackup_to_shell — pg_basebackupモジュール"shell"の例</td><td width="20%" align="right"> <a accesskey="n" href="basic-archive.html" title="F.5. basic_archive — WALアーカイブモジュールの例">次へ</a></td></tr></table><hr /></div><div class="sect1" id="BASEBACKUP-TO-SHELL"><div class="titlepage"><div><div><h2 class="title" style="clear: both">F.4. basebackup_to_shell — pg_basebackupモジュール"shell"の例 <a href="#BASEBACKUP-TO-SHELL" class="id_link">#</a></h2></div></div></div><span class="original">
<title>basebackup_to_shell &mdash; example "shell" pg_basebackup module</title>
</span><a id="id-1.11.7.14.2" class="indexterm"></a><p>
<span class="original">
<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.
</span>
<code class="filename">basebackup_to_shell</code>は、<code class="literal">shell</code>という名前のカスタムbasebackupターゲットを追加します。
これにより、<code class="command">pg_basebackup --target=shell</code>を実行するか、このモジュールの設定方法に応じて<code class="command">pg_basebackup --target=shell:<em class="replaceable"><code>DETAIL_STRING</code></em></code>を実行し、サーバ管理者が選択したサーバコマンドを、バックアッププロセスで生成されたtarアーカイブごとに実行させることができます。
コマンドは、標準入力を介してアーカイブの内容を受け取ります。
</p><p>
<span class="original">
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"/>.
</span>
このモジュールは主に、拡張モジュールを使用して新しいバックアップターゲットを作成する方法の例として作成されていますが、シナリオによってはそれ自体が役立つ場合があります。
このモジュールを機能させるには、<a class="xref" href="runtime-config-client.html#GUC-SHARED-PRELOAD-LIBRARIES">shared_preload_libraries</a>または<a class="xref" href="runtime-config-client.html#GUC-LOCAL-PRELOAD-LIBRARIES">local_preload_libraries</a>を使用してロードする必要があります。
</p><div class="sect2" id="BASEBACKUP-TO-SHELL-CONFIGURATION-PARAMETERS"><div class="titlepage"><div><div><h3 class="title">F.4.1. 設定パラメータ <a href="#BASEBACKUP-TO-SHELL-CONFIGURATION-PARAMETERS" class="id_link">#</a></h3></div></div></div><span class="original">
<title>Configuration Parameters</title>
</span><div class="variablelist"><dl class="variablelist"><dt><span class="term">
<code class="varname">basebackup_to_shell.command</code> (<code class="type">string</code>)
<a id="id-1.11.7.14.5.2.1.1.3" class="indexterm"></a>
<a id="id-1.11.7.14.5.2.1.1.4" class="indexterm"></a>
</span></dt><dd><p>
<span class="original">
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.
</span>
バックアップ処理によって生成された各アーカイブに対してサーバが実行する必要があるコマンドです。
コマンド文字列に<code class="literal">%f</code>が含まれている場合は、アーカイブの名前に置き換えられます(<code class="literal">例:base.tar</code>)。
コマンド文字列に<code class="literal">%d</code>が含まれている場合は、ユーザが指定したターゲット詳細に置き換えられます。
コマンド文字列に<code class="literal">%d</code>が使用されている場合は、ターゲット詳細が必要です。
それ以外の場合は禁止されています。
セキュリティ上の理由から、ターゲット詳細には英数字のみを使用できます。
<code class="literal">%%</code>がコマンド文字列に含まれている場合は、単一の<code class="literal">%</code>に置き換えられます。
<code class="literal">%</code>がコマンド文字列に含まれていて、その後に他の文字または文字列の末尾にある場合は、エラーが発生します。
</p></dd><dt><span class="term">
<code class="varname">basebackup_to_shell.required_role</code> (<code class="type">string</code>)
<a id="id-1.11.7.14.5.2.2.1.3" class="indexterm"></a>
<a id="id-1.11.7.14.5.2.2.1.4" class="indexterm"></a>
</span></dt><dd><p>
<span class="original">
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.
</span>
<code class="literal">shell</code>バックアップターゲットを使用するために必要なロールです。
これが設定されていない場合、レプリケーションユーザは<code class="literal">shell</code>バックアップターゲットを使用できます。
</p></dd></dl></div></div><div class="sect2" id="BASEBACKUP-TO-SHELL-AUTHOR"><div class="titlepage"><div><div><h3 class="title">F.4.2. 作者 <a href="#BASEBACKUP-TO-SHELL-AUTHOR" class="id_link">#</a></h3></div></div></div><span class="original">
<title>Author</title>
</span><p>
Robert Haas <code class="email"><<a class="email" href="mailto:rhaas@postgresql.org">rhaas@postgresql.org</a>></code>
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="auto-explain.html" title="F.3. auto_explain — 低速な問い合わせ実行計画のログ">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="contrib.html" title="付録F 追加で提供されるモジュールと拡張">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="basic-archive.html" title="F.5. basic_archive — WALアーカイブモジュールの例">次へ</a></td></tr><tr><td width="40%" align="left" valign="top">F.3. auto_explain — 低速な問い合わせ実行計画のログ </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.3文書">ホーム</a></td><td width="40%" align="right" valign="top"> F.5. basic_archive — WALアーカイブモジュールの例</td></tr></table></div></body></html>