f679de9e3f2e0f7fe97e8c8e3d651e9766f786fc
[debian/amanda] / man / xml-source / amzfs-snapshot.8.xml
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3                    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
4 [
5   <!-- entities files to use -->
6   <!ENTITY % global_entities SYSTEM '../entities/global.entities'>
7   %global_entities;
8 ]>
9
10 <refentry id='amzfs-snapshot.8'>
11
12 <refmeta>
13 <refentrytitle>amzfs-snapshot</refentrytitle>
14 <manvolnum>8</manvolnum>
15 &rmi.source;
16 &rmi.version;
17 &rmi.manual.8;
18 </refmeta>
19 <refnamediv>
20 <refname>amzfs-snapshot</refname>
21 <refpurpose>Amanda script to create zfs snapshot</refpurpose>
22 </refnamediv>
23 <refentryinfo>
24 &author.jlm;
25 &author.dustin;
26 </refentryinfo>
27 <!-- body begins here -->
28
29 <refsect1><title>DESCRIPTION</title>
30
31 <para>amzfs-snapshot is an &A; script implementing the Script API.  It should
32 not be run by users directly.  It create a zfs snapshot of the filesystem
33 where the path specified is mounted.</para>
34
35 <para>PRE-DLE-* create a snapshot and the POST_DLE_* destroy the snapshot,
36 *-DLE-AMCHECK, *-DLE-ESTIMATE and *-DLE-BACKUP must be set to be executed on the client:
37 <programlisting>
38     execute-on  pre-dle-amcheck, post-dle-amcheck, pre-dle-estimate, post-dle-estimate, pre-dle-backup, post-dle-backup
39     execute-where client
40 </programlisting></para>
41 <para>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.</para>
42
43 <para>The script is run as the amanda user, it must have the priviledge to create and destroy snapshot:
44 <programlisting>
45     zfs allow -ldu AMANDA_USER mount,snapshot,destroy FILESYSTEM
46 </programlisting></para>
47
48 <para>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:
49 <programlisting>
50 usermod -P "ZFS File System Management,ZFS Storage Management" AMANDA_USER
51 </programlisting>
52 This will require that your run zfs under pfexec, set the PFEXEC property to YES.</para>
53
54 <para>The format of the DLE must be one of:
55 <programlisting>
56 Desciption              Example
57 ----------              -------
58 Mountpoint              /data
59 Arbitrary mounted dir   /data/interesting_dir
60 ZFS pool name           datapool
61 ZFS filesystem          datapool/database
62 ZFS logical volume      datapool/dbvol
63 </programlisting></para>
64 <para>The filesystem must be mounted.</para>
65
66 </refsect1>
67
68 <refsect1><title>PROPERTIES</title>
69
70 <para>This section lists the properties that control amzfs-snapshot's functionality.
71 See <citerefentry><refentrytitle>amanda-scripts</refentrytitle><manvolnum>7</manvolnum></citerefentry>
72 for information on the Script API, script configuration.</para>
73
74 <!-- PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER -->
75 <variablelist>
76  <!-- ==== -->
77  <varlistentry><term>DF-PATH</term><listitem>
78 Path to the 'df' binary, search in $PATH by default.
79 </listitem></varlistentry>
80  <!-- ==== -->
81  <varlistentry><term>ZFS-PATH</term><listitem>
82 Path to the 'zfs' binary, search in $PATH by default.
83 </listitem></varlistentry>
84  <!-- ==== -->
85  <varlistentry><term>PFEXEC-PATH</term><listitem>
86 Path to the 'pfexec' binary, search in $PATH by default.
87 </listitem></varlistentry>
88  <!-- ==== -->
89  <varlistentry><term>PFEXEC</term><listitem>
90 If "NO" (the default), pfexec is not used, if set to "YES" then pfexec is used.
91 </listitem></varlistentry>
92 </variablelist>
93
94 </refsect1>
95
96 <refsect1><title>EXAMPLE</title>
97
98 In this example, a dumptype is defined to use amzfs-snapshot script to create a snapshot and use amgtar to backup the snapshot.
99
100 <programlisting>
101  define script-tool amzfs_snapshot {
102    comment "backup of zfs snapshot"
103    plugin  "amzfs-snapshot"
104    execute-on  pre-dle-amcheck, post-dle-amcheck, pre-dle-estimate, post-dle-estimate, pre-dle-backup, post-dle-backup
105    execute-where client
106    #property "DF-PATH" "/usr/sbin/df"
107    #property "ZFS-PATH" "/usr/sbin/zfs"
108    #property "PFEXEC-PATH" "/usr/sbin/pfexec"
109    #property "PFEXEC" "NO"
110  }
111
112  define dumptype user-zfs-amgtar {
113    dt_amgtar
114    script "amzfs_snapshot"
115  }
116 </programlisting>
117 </refsect1>
118
119 <refsect1><title>SEE ALSO</title>
120 <para>
121 <citerefentry><refentrytitle>amanda.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
122 <citerefentry><refentrytitle>amanda-client.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
123 <citerefentry><refentrytitle>amanda-scripts</refentrytitle><manvolnum>7</manvolnum></citerefentry>
124 </para>
125
126 </refsect1>
127 </refentry>