1 <!-- doc/src/sgml/basic-archive.sgml -->
3 <sect1 id=
"basic-archive" xreflabel=
"basic_archive">
4 <title>basic_archive
— an example WAL archive module
</title>
6 <indexterm zone=
"basic-archive">
7 <primary>basic_archive
</primary>
11 <filename>basic_archive
</filename> is an example of an archive module. This
12 module copies completed WAL segment files to the specified directory. This
13 may not be especially useful, but it can serve as a starting point for
14 developing your own archive module. For more information about archive
15 modules, see
<xref linkend=
"archive-modules"/>.
19 In order to function, this module must be loaded via
20 <xref linkend=
"guc-archive-library"/>, and
<xref linkend=
"guc-archive-mode"/>
24 <sect2 id=
"basic-archive-configuration-parameters">
25 <title>Configuration Parameters
</title>
30 <varname>basic_archive.archive_directory
</varname> (
<type>string
</type>)
32 <primary><varname>basic_archive.archive_directory
</varname> configuration parameter
</primary>
37 The directory where the server should copy WAL segment files. This
38 directory must already exist. The default is an empty string, which
39 effectively halts WAL archiving, but if
<xref linkend=
"guc-archive-mode"/>
40 is enabled, the server will accumulate WAL segment files in the
41 expectation that a value will soon be provided.
48 These parameters must be set in
<filename>postgresql.conf
</filename>.
49 Typical usage might be:
55 archive_library = 'basic_archive'
56 basic_archive.archive_directory = '/path/to/archive/directory'
60 <sect2 id=
"basic-archive-notes">
64 Server crashes may leave temporary files with the prefix
65 <filename>archtemp
</filename> in the archive directory. It is recommended to
66 delete such files before restarting the server after a crash. It is safe to
67 remove such files while the server is running as long as they are unrelated
68 to any archiving still in progress, but users should use extra caution when
73 <sect2 id=
"basic-archive-author">