Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Add runrep.sh, which we will use to start replication
Browse files Browse the repository at this point in the history
  • Loading branch information
Kris Moore committed Aug 1, 2013
1 parent 21a1adc commit 9fa96a3
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src-sh/lpreserver/backend/runrep.sh
@@ -0,0 +1,32 @@
#!/bin/sh
# Do the replication for a specific dataset
######################################################################

# Set our vars
PROGDIR="/usr/local/share/lpreserver"

# Source our functions
. /usr/local/share/pcbsd/scripts/functions.sh
. ${PROGDIR}/backend/functions.sh

DATASET="${1}"

if [ -z "${DATASET}" ]; then
exit_err "No dataset specified!"
fi

# Lets start by building a list of props to keep
pTag=`echo $DATASET | md5`

if [ "$RECURMODE" = "ON" ] ; then
zfs get -r all $DATASET | grep ' local$' | awk '{$1=$1}1' OFS=" " > /tmp/.propList.$$
else
zfs get all $DATASET | grep ' local$' | awk '{$1=$1}1' OFS=" " > /tmp/.propList.$$
fi

cat /tmp/.propList.$$
rm /tmp/.propList.$$

if [ "$EMAILMODE" = "ALL" ] ; then
#email_msg "Automated Snapshot" "`echo_queue_msg`"
fi

0 comments on commit 9fa96a3

Please sign in to comment.