summaryrefslogtreecommitdiffstats
path: root/zfs_create_dated_snapshot.sh
blob: 11f94efc049d0c93a69822a10102f0ca2d654b23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

if (($#<2)); then
	echo "usage: ${0##*/} <filesystem|volume> <snapshot prefix>"
	exit 1
fi

filesystem=$1
snapshotname=$2
date="$(date +%FT%H:%M)"

zfs snapshot "${filesystem}@${snapshotname}${date}"