/[sysadmin-cookbook]/recepies/zfs/zfs-snapshot-to-ve.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /recepies/zfs/zfs-snapshot-to-ve.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 48 by dpavlin, Sun May 10 13:01:49 2009 UTC revision 49 by dpavlin, Sun May 10 13:43:38 2009 UTC
# Line 9  if [ -z "$fs" ] ; then Line 9  if [ -z "$fs" ] ; then
9  fi  fi
10    
11  orig=`echo $fs | cut -d/ -f3 | cut -d@ -f1`  orig=`echo $fs | cut -d/ -f3 | cut -d@ -f1`
12    pool=`echo $fs | cut -d/ -f1`
13    
14  echo "clone $fs -- $orig to $veid";  echo "clone $fs -- $orig to $veid";
15    
16  clone=opl/clone/$orig-$veid  clone=$pool/clone/$orig-$veid
17    
18  vzctl stop $veid && (  vzctl stop $veid && (
19          umount /$clone          umount /$clone
20          zfs destroy $clone          zfs destroy $clone
21  )  )
22    
23  zfs clone $fs opl/clone/$orig-$veid  zfs clone $fs $pool/clone/$orig-$veid
24    
25  vzctl start 60017  vzctl start 60017
26    

Legend:
Removed from v.48  
changed lines
  Added in v.49

  ViewVC Help
Powered by ViewVC 1.1.26