|
NAMEsnapshot —
UFS/ZFS snapshot management utility
SYNOPSIS
DESCRIPTIONThesnapshot command is a convenience frontend to
mount(8)
and
mdconfig(8)
for the management of UFS/ZFS snapshots. It is also the underlying tool used
in the periodic snapshot scheduler
periodic-snapshot(8)
and the mounting/unmouning command in the
amd(8) map
/etc/amd.map.snap. It provides the making, expiring,
visiting, mounting and unmounting of filesystem snapshots.
The following global options are available:
The following commands are available:
EXAMPLEThe following sample session illustrates the making, rotation, mounting, unmounting and removal of snapshots:root# snapshot list /var Filesystem User User% Snap Snap% Snapshot root# snapshot make -g4 /var:test root# snapshot list /var Filesystem User User% Snap Snap% Snapshot /var 1172MB 14.8% 4MB 0.1% test.0 root# snapshot make -g4 /var:test root# snapshot list /var Filesystem User User% Snap Snap% Snapshot /var 1176MB 14.8% 4MB 0.1% test.0 /var 1176MB 14.8% 4MB 0.1% test.1 root# snapshot make -g4 /var:test root# snapshot list /var Filesystem User User% Snap Snap% Snapshot /var 1181MB 14.9% 4MB 0.1% test.0 /var 1181MB 14.9% 4MB 0.1% test.1 /var 1181MB 14.9% 4MB 0.1% test.2 root# snapshot make -g4 /var:test root# snapshot list /var Filesystem User User% Snap Snap% Snapshot /var 1186MB 15.0% 4MB 0.1% test.0 /var 1186MB 15.0% 4MB 0.1% test.1 /var 1186MB 15.0% 4MB 0.1% test.2 /var 1186MB 15.0% 4MB 0.1% test.3 root# snapshot make -g4 /var:test root# snapshot list /var Filesystem User User% Snap Snap% Snapshot /var 1186MB 15.0% 4MB 0.1% test.0 /var 1186MB 15.0% 4MB 0.1% test.1 /var 1186MB 15.0% 4MB 0.1% test.2 /var 1186MB 15.0% 4MB 0.1% test.3 root# snapshot mount /var:test.2 /mnt root# ls /mnt account cron heimdal mail opkg spool at db lib msgs preserve tmp backups empty log named run yp root# snapshot umount /mnt root# snapshot make -g0 /var:test root# snapshot list /var Filesystem User User% Snap Snap% Snapshot root# _ By using an amd(8) map /usr/local/etc/amd.map.snap containing /defaults type:=program * mount:="/usr/local/sbin/snapshot snapshot mount /${key} ${fs}";\ unmount:="/usr/local/sbin/snapshot snapshot umount ${fs}" and a /etc/rc.conf configuration of amd_enable="YES" amd_flags="-a /.am -c 1800 -w 60 -l syslog /snap /usr/local/etc/amd.map.snap" even non-privileged users can access arbitrary snapshots fs:tag[generation] by just accessing /snap/fs:tag[generation]. For instance, if a snapshot hourly.2 exists on filesystem /var one can then access an old state of file /var/tmp/foo.txt by simply accessing the path /snap/var:hourly.2/tmp/foo.txt. SEE ALSOmount(8), mdconfig(8), md(4), periodic-snapshot(8), http://people.freebsd.org/~rse/snapshot/.HISTORYThesnapshot utility first appeared in
FreeBSD.
AUTHORSRalf S. Engelschall ⟨rse@FreeBSD.org⟩
Visit the GSP FreeBSD Man Page Interface. |