[PC-BSD Commits] r17693 - pcbsd/current/src-sh/warden/scripts/backend
svn at pcbsd.org
svn at pcbsd.org
Mon Jul 9 10:37:20 PDT 2012
Author: kris
Date: 2012-07-09 17:37:19 +0000 (Mon, 09 Jul 2012)
New Revision: 17693
Modified:
pcbsd/current/src-sh/warden/scripts/backend/functions.sh
Log:
Print error if we try to clone a snapshot that is already done
Modified: pcbsd/current/src-sh/warden/scripts/backend/functions.sh
===================================================================
--- pcbsd/current/src-sh/warden/scripts/backend/functions.sh 2012-07-09 17:25:26 UTC (rev 17692)
+++ pcbsd/current/src-sh/warden/scripts/backend/functions.sh 2012-07-09 17:37:19 UTC (rev 17693)
@@ -355,6 +355,10 @@
zfs list -t snapshot | grep -w "^${tank}${1}" | cut -d '@' -f 2 | awk '{print $1}' | grep -q ${2}
if [ $? -ne 0 ] ; then printerror "Invalid ZFS snapshot!" ; fi
+ if [ -d "${CDIR}/${3}-${2}" ] ; then
+ printerror "This snapshot is already cloned and mounted at: ${CDIR}/${3}-${2}"
+ fi
+
# Clone the snapshot
zfs clone -p ${tank}${1}@$2 ${tank}${CDIR}/${3}-${2}
More information about the Commits
mailing list