From 4788e7843609b2234914580bbe1f8a4cd4b6e3d1 Mon Sep 17 00:00:00 2001 From: Jose Date: Wed, 8 Apr 2020 23:21:13 -0400 Subject: [PATCH] Code cleanup, don't delete snapshot recursively --- usr/local/share/bastille/clone.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr/local/share/bastille/clone.sh b/usr/local/share/bastille/clone.sh index 621b4ef..646ab58 100644 --- a/usr/local/share/bastille/clone.sh +++ b/usr/local/share/bastille/clone.sh @@ -159,11 +159,11 @@ clone_jail() { if ! [ -d "${bastille_jailsdir}/${NEWNAME}" ]; then if [ "${bastille_zfs_enable}" = "YES" ]; then if [ -n "${bastille_zfs_zpool}" ]; then - # Rename ZFS dataset and mount points accordingly + # Replicate the existing container DATE=$(date +%F-%H%M%S) zfs snapshot -r "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${TARGET}@bastille_clone_${DATE}" zfs send -R "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${TARGET}@bastille_clone_${DATE}" | zfs recv "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${NEWNAME}" - zfs destroy -r "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${TARGET}@bastille_clone_${DATE}" + zfs destroy "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${TARGET}@bastille_clone_${DATE}" fi else # Just clone the jail directory @@ -207,4 +207,4 @@ else usage fi -clone_jail \ No newline at end of file +clone_jail