Debian Codegraph @

docs/api_reference/CXX/envdbbackup.html

raw symbols SCIP
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">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <title>DbEnv::dbbackup()</title>
7 <link rel="stylesheet" href="apiReference.css" type="text/css" />
8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9 <link rel="start" href="index.html" title="Berkeley DB C++ API Reference" />
10 <link rel="up" href="env.html" title="Chapter 5.  The DbEnv Handle" />
11 <link rel="prev" href="envcreate.html" title="DbEnv" />
12 <link rel="next" href="envdbremove.html" title="DbEnv::dbremove()" />
13 </head>
14 <body>
15 <div xmlns="" class="navheader">
16 <div class="libver">
17 <p>Library Version 11.2.5.3</p>
18 </div>
19 <table width="100%" summary="Navigation header">
20 <tr>
21 <th colspan="3" align="center">DbEnv::dbbackup()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="envcreate.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 5. 
26 The DbEnv Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="envdbremove.html">Next</a></td>
29 </tr>
30 </table>
31 <hr />
32 </div>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
35 <div>
36 <div>
37 <h2 class="title" style="clear: both"><a id="envdbbackup"></a>DbEnv::dbbackup()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbEnv::dbbackup(const char *dbfile, const char *target,
45 u_int32_t flags);</pre>
46 <p>
47 The <code class="methodname">DbEnv::dbbackup()</code> method performs a hot
48 backup of a single database file contained within the environment.
49 </p>
50 <p>
51 To back up an entire environment, use the
52 <a class="xref" href="envbackup.html" title="DbEnv::backup()">DbEnv::backup()</a>
53 method.
54 </p>
55 <p>
56 This method's default behavior can be changed by setting backup
57 callbacks. See
58 <a class="xref" href="envset_backup_callbacks.html" title="DbEnv::set_backup_callbacks()">DbEnv::set_backup_callbacks()</a>
59 for more information. Additional tuning parameters can also be set
60 using the
61 <a class="xref" href="envset_backup_config.html" title="DbEnv::set_backup_config()">DbEnv::set_backup_config()</a> method.
62 </p>
63 <p>
64 The <code class="methodname">DbEnv::dbbackup()</code> method may only be
65 called after the environment handle has been opened.
66 </p>
67 <p>
68 The <code class="methodname">DbEnv::dbbackup()</code> <span>
69
70 <span>
71 method either returns a non-zero error value or throws an
72 exception that encapsulates a non-zero error value on
73 failure, and returns 0 on success.
74 </span>
75 </span>
76 </p>
77 <div class="sect2" lang="en" xml:lang="en">
78 <div class="titlepage">
79 <div>
80 <div>
81 <h3 class="title"><a id="idp6651504"></a>Parameters</h3>
82 </div>
83 </div>
84 </div>
85 <div class="sect3" lang="en" xml:lang="en">
86 <div class="titlepage">
87 <div>
88 <div>
89 <h4 class="title"><a id="idp6652104"></a>dbfile</h4>
90 </div>
91 </div>
92 </div>
93 <p>
94 Identifies the database file that you want to back up.
95 </p>
96 </div>
97 <div class="sect3" lang="en" xml:lang="en">
98 <div class="titlepage">
99 <div>
100 <div>
101 <h4 class="title"><a id="idp6666272"></a>target</h4>
102 </div>
103 </div>
104 </div>
105 <p>
106 Identifies the directory in which the back up will be
107 placed. This target must exist; otherwise this method
108 exits with an <code class="literal">ENOENT</code> error return.
109 </p>
110 <p>
111 Note that if the backup callbacks are set, then the value
112 specified to this parameter is passed on to the
113 <code class="literal">open_func()</code> callback. If this
114 parameter is NULL, then the target must be specified
115 directly to the <code class="literal">open_func()</code> callback.
116 </p>
117 </div>
118 <div class="sect3" lang="en" xml:lang="en">
119 <div class="titlepage">
120 <div>
121 <div>
122 <h4 class="title"><a id="idp6658880"></a>flags</h4>
123 </div>
124 </div>
125 </div>
126 <p>
127 The <span class="bold"><strong>flags</strong></span> parameter must
128 be set to 0 or the following value:
129 </p>
130 <div class="itemizedlist">
131 <ul type="disc">
132 <li>
133 <p>
134 <code class="literal">DB_EXCL</code>
135 </p>
136 <p>
137 Return an <code class="literal">EEXIST</code> error if a
138 target backup file already exists.
139 </p>
140 </li>
141 </ul>
142 </div>
143 </div>
144 </div>
145 <div class="sect2" lang="en" xml:lang="en">
146 <div class="titlepage">
147 <div>
148 <div>
149 <h3 class="title"><a id="idp6668720"></a>Errors</h3>
150 </div>
151 </div>
152 </div>
153 <p>
154 The <code class="methodname">DbEnv::dbbackup()</code> <span>
155
156 <span>
157 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
158 exception, encapsulating one of the following non-zero errors, or return one
159 of the following non-zero errors:
160 </span>
161 </span>
162 </p>
163 <div class="sect3" lang="en" xml:lang="en">
164 <div class="titlepage">
165 <div>
166 <div>
167 <h4 class="title"><a id="idp6677600"></a>EEXIST</h4>
168 </div>
169 </div>
170 </div>
171 <p>
172 <code class="literal">DB_EXCL</code> was specified for the
173 <code class="literal">flags</code> parameter, and an existing target
174 file was discovered when attempting to back up a source
175 file.
176 </p>
177 </div>
178 <div class="sect3" lang="en" xml:lang="en">
179 <div class="titlepage">
180 <div>
181 <div>
182 <h4 class="title"><a id="idp6673584"></a>ENOENT</h4>
183 </div>
184 </div>
185 </div>
186 <p>
187 The target directory does not exist.
188 </p>
189 </div>
190 <div class="sect3" lang="en" xml:lang="en">
191 <div class="titlepage">
192 <div>
193 <div>
194 <h4 class="title"><a id="idp6677816"></a>EINVAL</h4>
195 </div>
196 </div>
197 </div>
198 <p>
199 An invalid flag value or parameter was specified.
200 </p>
201 </div>
202 </div>
203 <div class="sect2" lang="en" xml:lang="en">
204 <div class="titlepage">
205 <div>
206 <div>
207 <h3 class="title"><a id="idp6643488"></a>Class</h3>
208 </div>
209 </div>
210 </div>
211 <p>
212 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>
213 </p>
214 </div>
215 <div class="sect2" lang="en" xml:lang="en">
216 <div class="titlepage">
217 <div>
218 <div>
219 <h3 class="title"><a id="idp6644328"></a>See Also</h3>
220 </div>
221 </div>
222 </div>
223 <p>
224 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a>
225 </p>
226 </div>
227 </div>
228 <div class="navfooter">
229 <hr />
230 <table width="100%" summary="Navigation footer">
231 <tr>
232 <td width="40%" align="left"><a accesskey="p" href="envcreate.html">Prev</a> </td>
233 <td width="20%" align="center">
234 <a accesskey="u" href="env.html">Up</a>
235 </td>
236 <td width="40%" align="right"> <a accesskey="n" href="envdbremove.html">Next</a></td>
237 </tr>
238 <tr>
239 <td width="40%" align="left" valign="top">DbEnv </td>
240 <td width="20%" align="center">
241 <a accesskey="h" href="index.html">Home</a>
242 </td>
243 <td width="40%" align="right" valign="top"> DbEnv::dbremove()</td>
244 </tr>
245 </table>
246 </div>
247 </body>
248 </html>