]> begriffs open source - ai-pg/blob - full-docs/html/basebackup-to-shell.html
Include latest toc output
[ai-pg] / full-docs / html / basebackup-to-shell.html
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!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 — example "shell" pg_basebackup module</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 — log execution plans of slow queries" /><link rel="next" href="basic-archive.html" title="F.5. basic_archive — an example WAL archive module" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">F.4. basebackup_to_shell — example "shell" pg_basebackup module</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="auto-explain.html" title="F.3. auto_explain — log execution plans of slow queries">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="contrib.html" title="Appendix F. Additional Supplied Modules and Extensions">Up</a></td><th width="60%" align="center">Appendix F. Additional Supplied Modules and Extensions</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="basic-archive.html" title="F.5. basic_archive — an example WAL archive module">Next</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 — example "shell" pg_basebackup module <a href="#BASEBACKUP-TO-SHELL" class="id_link">#</a></h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="basebackup-to-shell.html#BASEBACKUP-TO-SHELL-CONFIGURATION-PARAMETERS">F.4.1. Configuration Parameters</a></span></dt><dt><span class="sect2"><a href="basebackup-to-shell.html#BASEBACKUP-TO-SHELL-AUTHOR">F.4.2. Author</a></span></dt></dl></div><a id="id-1.11.7.14.2" class="indexterm"></a><p>
3   <code class="filename">basebackup_to_shell</code> adds a custom basebackup target
4   called <code class="literal">shell</code>. This makes it possible to run
5   <code class="command">pg_basebackup --target=shell</code> or, depending on how this
6   module is configured,
7   <code class="command">pg_basebackup --target=shell:<em class="replaceable"><code>DETAIL_STRING</code></em></code>,
8   and cause a server command chosen by the server administrator to be executed
9   for each tar archive generated by the backup process. The command will receive
10   the contents of the archive via standard input.
11  </p><p>
12   This module is primarily intended as an example of how to create a new
13   backup targets via an extension module, but in some scenarios it may be
14   useful for its own sake.
15   In order to function, this module must be loaded via
16   <a class="xref" href="runtime-config-client.html#GUC-SHARED-PRELOAD-LIBRARIES">shared_preload_libraries</a> or
17   <a class="xref" href="runtime-config-client.html#GUC-LOCAL-PRELOAD-LIBRARIES">local_preload_libraries</a>.
18  </p><div class="sect2" id="BASEBACKUP-TO-SHELL-CONFIGURATION-PARAMETERS"><div class="titlepage"><div><div><h3 class="title">F.4.1. Configuration Parameters <a href="#BASEBACKUP-TO-SHELL-CONFIGURATION-PARAMETERS" class="id_link">#</a></h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">
19      <code class="varname">basebackup_to_shell.command</code> (<code class="type">string</code>)
20      <a id="id-1.11.7.14.5.2.1.1.3" class="indexterm"></a>
21     </span></dt><dd><p>
22       The command which the server should execute for each archive generated
23       by the backup process. If <code class="literal">%f</code> occurs in the command
24       string, it will be replaced by the name of the archive (e.g.
25       <code class="literal">base.tar</code>). If <code class="literal">%d</code> occurs in the
26       command string, it will be replaced by the target detail provided by
27       the user. A target detail is required if <code class="literal">%d</code> is
28       used in the command string, and prohibited otherwise. For security
29       reasons, it may contain only alphanumeric characters. If
30       <code class="literal">%%</code> occurs in the command string, it will be replaced
31       by a single <code class="literal">%</code>. If <code class="literal">%</code> occurs in
32       the command string followed by any other character or at the end of the
33       string, an error occurs.
34      </p></dd><dt><span class="term">
35      <code class="varname">basebackup_to_shell.required_role</code> (<code class="type">string</code>)
36      <a id="id-1.11.7.14.5.2.2.1.3" class="indexterm"></a>
37     </span></dt><dd><p>
38       The role required in order to make use of the <code class="literal">shell</code>
39       backup target. If this is not set, any replication user may make use of
40       the <code class="literal">shell</code> backup target.
41      </p></dd></dl></div></div><div class="sect2" id="BASEBACKUP-TO-SHELL-AUTHOR"><div class="titlepage"><div><div><h3 class="title">F.4.2. Author <a href="#BASEBACKUP-TO-SHELL-AUTHOR" class="id_link">#</a></h3></div></div></div><p>
42    Robert Haas <code class="email">&lt;<a class="email" href="mailto:rhaas@postgresql.org">rhaas@postgresql.org</a>&gt;</code>
43   </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 — log execution plans of slow queries">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="contrib.html" title="Appendix F. Additional Supplied Modules and Extensions">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="basic-archive.html" title="F.5. basic_archive — an example WAL archive module">Next</a></td></tr><tr><td width="40%" align="left" valign="top">F.3. auto_explain — log execution plans of slow queries </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="40%" align="right" valign="top"> F.5. basic_archive — an example WAL archive module</td></tr></table></div></body></html>