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"
5 <!-- entities files to use -->
6 <!ENTITY % global_entities SYSTEM 'global.entities'>
10 <refentry id='amzfs-snapshot.8'>
13 <refentrytitle>amzfs-snapshot</refentrytitle>
14 <manvolnum>8</manvolnum>
20 <refname>amzfs-snapshot</refname>
21 <refpurpose>Amanda script to create zfs snapshot</refpurpose>
27 <!-- body begins here -->
29 <refsect1><title>DESCRIPTION</title>
31 <para>amzfs-snapshot is an Amanda 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>
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:
38 execute-on pre-dle-amcheck, post-dle-amcheck, pre-dle-estimate, post-dle-estimate, pre-dle-backup, post-dle-backup
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>
43 <para>The script is run as the amanda user, it must have the priviledge to create and destroy snapshot:
45 zfs allow -ldu AMANDA_USER mount,snapshot,destroy FILESYSTEM
46 </programlisting></para>
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:
50 usermod -P "ZFS File System Management,ZFS Storage Management" AMANDA_USER
52 This will require that your run zfs under pfexec, set the PFEXEC property to YES.</para>
54 <para>The format of the DLE must be one of:
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>
68 <refsect1><title>PROPERTIES</title>
70 <para>This section lists the properties that control amzfs-snapshot's functionality.
71 See <manref name="amanda-scripts" vol="7"/>
72 for information on the Script API, script configuration.</para>
74 <!-- PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER -->
77 <varlistentry><term>DF-PATH</term><listitem>
78 Path to the 'df' binary, search in $PATH by default.
79 </listitem></varlistentry>
81 <varlistentry><term>ZFS-PATH</term><listitem>
82 Path to the 'zfs' binary, search in $PATH by default.
83 </listitem></varlistentry>
85 <varlistentry><term>PFEXEC-PATH</term><listitem>
86 Path to the 'pfexec' binary, search in $PATH by default.
87 </listitem></varlistentry>
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>
96 <refsect1><title>EXAMPLE</title>
98 In this example, a dumptype is defined to use amzfs-snapshot script to create a snapshot and use amgtar to backup the snapshot.
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
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"
112 define dumptype user-zfs-amgtar {
114 script "amzfs_snapshot"
120 <manref name="amanda.conf" vol="5"/>,
121 <manref name="amanda-client.conf" vol="5"/>,
122 <manref name="amanda-scripts" vol="7"/>