1 .\" Title: amzfs-snapshot
2 .\" Author: Jean-Louis Martineau <martineau@zmanda.com>
3 .\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>
5 .\" Manual: System Administration Commands
6 .\" Source: Amanda 2.6.1
9 .TH "AMZFS\-SNAPSHOT" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands"
10 .\" -----------------------------------------------------------------
11 .\" * (re)Define some macros
12 .\" -----------------------------------------------------------------
13 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 .\" toupper - uppercase a string (locale-aware)
15 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17 .tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
19 .tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
21 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22 .\" SH-xref - format a cross-reference to an SH section
23 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33 .\" SH - level-one heading that works better for non-TTY output
34 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36 .\" put an extra blank line of space above the head in non-TTY output
43 .nr an-prevailing-indent \\n[IN]
47 .HTML-TAG ".NH \\n[an-level]"
49 .nr an-no-space-flag 1
51 \." make the size of the head bigger
56 .\" if n (TTY output), use uppercase
61 .\" if not n (not TTY), use normal case (not uppercase)
65 .\" if not n (not TTY), put a border/line under subheading
70 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71 .\" SS - level-two heading that works better for non-TTY output
72 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
77 .nr an-prevailing-indent \\n[IN]
82 .nr an-no-space-flag 1
85 \." make the size of the head bigger
91 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92 .\" BB/BE - put background/screen (filled box) around block of text
93 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
106 .if "\\$2"adjust-for-leading-newline" \{\
114 .nr BW \\n(.lu-\\n(.i
117 .ie "\\$2"adjust-for-leading-newline" \{\
118 \M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
121 \M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
132 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133 .\" BM/EM - put colored marker in margin next to block of text
134 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
151 \M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
159 .\" -----------------------------------------------------------------
160 .\" * set default formatting
161 .\" -----------------------------------------------------------------
162 .\" disable hyphenation
164 .\" disable justification (adjust text to left margin only)
166 .\" -----------------------------------------------------------------
167 .\" * MAIN CONTENT STARTS HERE *
168 .\" -----------------------------------------------------------------
170 amzfs-snapshot \- Amanda script to create zfs snapshot
173 amzfs\-snapshot is an
175 script implementing the Script API\&. It should not be run by users directly\&. It create a zfs snapshot of the filesystem where the path specified is mounted\&.
177 PRE\-DLE\-* create a snapshot and the POST_DLE_* destroy the snapshot, *\-DLE\-AMCHECK, *\-DLE\-ESTIMATE and *\-DLE\-BACKUP must be set to be executed on the client:
180 execute\-on pre\-dle\-amcheck, post\-dle\-amcheck, pre\-dle\-estimate, post\-dle\-estimate, pre\-dle\-backup, post\-dle\-backup
181 execute\-where client
184 The PRE_DLE_* script output a DIRECTORY property telling where the directory is located in the snapshot\&. The application must be able to use the DIRECTORY property, amgtar can do it\&.
186 The script is run as the amanda user, it must have the priviledge to create and destroy snapshot:
189 zfs allow \-ldu AMANDA_USER mount,snapshot,destroy FILESYSTEM
192 Some system doesn\'t have "zfs allow", but you can give the Amanda backup user the rights to manipulate ZFS filesystems by using the following command:
195 usermod \-P "ZFS File System Management,ZFS Storage Management" AMANDA_USER
197 This will require that your run zfs under pfexec, set the PFEXEC property to YES\&.
199 The format of the DLE must be one of:
203 \-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-
205 Arbitrary mounted dir /data/interesting_dir
206 ZFS pool name datapool
207 ZFS filesystem datapool/database
208 ZFS logical volume datapool/dbvol
211 The filesystem must be mounted\&.
214 This section lists the properties that control amzfs\-snapshot\'s functionality\&. See
215 \fBamanda-scripts\fR(7)
216 for information on the Script API, script configuration\&.
221 Path to the \'df\' binary, search in $PATH by default\&.
227 Path to the \'zfs\' binary, search in $PATH by default\&.
233 Path to the \'pfexec\' binary, search in $PATH by default\&.
239 If "NO" (the default), pfexec is not used, if set to "YES" then pfexec is used\&.
244 In this example, a dumptype is defined to use amzfs\-snapshot script to create a snapshot and use amgtar to backup the snapshot\&.
246 define script\-tool amzfs_snapshot {
247 comment "backup of zfs snapshot"
248 plugin "amzfs\-snapshot"
249 execute\-on pre\-dle\-amcheck, post\-dle\-amcheck, pre\-dle\-estimate, post\-dle\-estimate, pre\-dle\-backup, post\-dle\-backup
250 execute\-where client
251 #property "DF\-PATH" "/usr/sbin/df"
252 #property "ZFS\-PATH" "/usr/sbin/zfs"
253 #property "PFEXEC\-PATH" "/usr/sbin/pfexec"
254 #property "PFEXEC" "NO"
257 define dumptype user\-zfs\-amgtar {
259 script "amzfs_snapshot"
265 \fBamanda.conf\fR(5),
266 \fBamanda-client.conf\fR(5),
267 \fBamanda-scripts\fR(7)
270 \fBJean\-Louis Martineau\fR <\&martineau@zmanda\&.com\&>
272 Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[])
275 \fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&>
277 Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[])