Changeset 7e703b7


Ignore:
Timestamp:
08/14/13 07:27:41 (13 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
fa6febe
Parents:
a5d7e1d
Message:

When we replicate to a remote host, now we create a new dataset based upon users hostname

This will allow us to use a single SSH key / remote user, and have multiple systems
backing up to different datasets.

Thanks Josh Paetzel!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/lpreserver/backend/functions.sh

    re977365 r7e703b7  
    263263start_rep_task() { 
    264264  LDATA="$1" 
     265  hName=`hostname` 
    265266 
    266267  # Check for the last snapshot marked as replicated already 
     
    280281  else 
    281282     zFLAGS="-Rv $LDATA@$lastSNAP" 
     283 
     284     # This is a first-time replication, lets create the new target dataset 
     285     ssh -p ${REPPORT} ${REPUSER}@${REPHOST} zfs create ${REPRDATA}/${hName} >${CMDLOG} 2>${CMDLOG} 
    282286  fi 
    283287 
    284288  zSEND="zfs send $zFLAGS" 
    285   zRCV="ssh -p ${REPPORT} ${REPUSER}@${REPHOST} zfs receive -dvuF ${REPRDATA}" 
     289  zRCV="ssh -p ${REPPORT} ${REPUSER}@${REPHOST} zfs receive -dvuF ${REPRDATA}/${hName}" 
    286290 
    287291  queue_msg "Using ZFS send command:\n$zSEND | $zRCV\n\n" 
     
    325329 
    326330  # Lets start by building a list of props to keep 
    327   rProp=".lp-props-`echo ${REPRDATA} | sed 's|/|#|g'`" 
     331  rProp=".lp-props-`echo ${REPRDATA}/${hName} | sed 's|/|#|g'`" 
    328332 
    329333  zfs get -r all $DATASET | grep ' local$' | awk '{$1=$1}1' OFS=" " | sed 's| local$||g' \ 
Note: See TracChangeset for help on using the changeset viewer.