X-Git-Url: http://git.pippins.net/embedvideo/.git/static/gitweb.js?a=blobdiff_plain;f=zfs-replicate-wrapper;h=c6c3369e5eec98211424805191b6091bc18f2a42;hb=471f2873d53eebe62223121be58bc3f795511a12;hp=a43e8fb75204542978af8ca62bdf00e0d679e36e;hpb=9a12c36d03babea71bd13dc208a64ff91f61b699;p=zfs-ubuntu%2F.git diff --git a/zfs-replicate-wrapper b/zfs-replicate-wrapper index a43e8fb..c6c3369 100755 --- a/zfs-replicate-wrapper +++ b/zfs-replicate-wrapper @@ -4,27 +4,16 @@ # Description: This script calls zfs-replicate for each filesystem needing # to be backed up, or replicated, to another ZFS pool. +# source our configuration +config="${0%/*}/zfs-scripts.conf" +[ -e "${config}.dist" ] && . ${config}.dist +[ -e "${config}" ] && . ${config} + # Setup some default values -zfsreplicate="/etc/bin/zfs-replicate" -logdir="/var/log/zfs" -logfile_parser="/etc/bin/zfs-log-parser" logfile="$logdir/zfs-replicate.log" mylogfile="$logdir/zfs-replicate-all.log" -remote="tank.pippins.net" -local_pool=backups -mailto=root@pippins.net date=`date` starttime=`date +%s` -zfs=/usr/sbin/zfs - -# Specify the list of filesystems to replicate -filesystems_to_replicate=' -naspool/www -naspool/git -' - -# Specify the maximum run time in minutes that this script can run (0=no limit) -maxruntime=240 # This function checks to see if our runtime has exceeded our stoptime timeexceeded() { @@ -52,7 +41,7 @@ trap cleanup_and_exit INT # This function executes the replicate command and checks the stoptime replicate() { - $zfsreplicate $* >> $logfile 2>&1 + zfs-replicate $* >> $logfile 2>&1 timeexceeded if [ $? == 1 ]; then cleanup_and_exit @@ -113,6 +102,6 @@ echo `date` ZFS replicate complete >> $logfile echo `data` ZFS replicate complete | tee -a $mylogfile # Parse the log file and extract our backup stats -$logfile_parser "$logfile" "$date" >> $logfile -$logfile_parser "$logfile" "$date" | tee -a $mylogfile +zfs-log-parser "$logfile" "$date" >> $logfile +zfs-log-parser "$logfile" "$date" | tee -a $mylogfile