From facb2db8f3bfa2e546dc7a3887b4fdae3950fe03 Mon Sep 17 00:00:00 2001 From: Otis Gospodnetic Date: Thu, 14 Aug 2008 13:41:56 +0000 Subject: [PATCH] SOLR-669 snappuler fix for FreeBSD/Darwin git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@685892 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 2 ++ src/scripts/snappuller | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 23516d68ea9..16cccfbc3eb 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -526,6 +526,8 @@ Bug Fixes 46. SOLR-696: Fixed bug in NamedListCodec in regards to serializing Iterable objects. (gsingers) +47. SOLR-669: snappuler fix for FreeBSD/Darwin (Richard "Trey" Hyde via Otis Gospodnetic) + Other Changes 1. SOLR-135: Moved common classes to org.apache.solr.common and altered the build scripts to make two jars: apache-solr-1.3.jar and diff --git a/src/scripts/snappuller b/src/scripts/snappuller index fd081ca31f4..14b75679142 100755 --- a/src/scripts/snappuller +++ b/src/scripts/snappuller @@ -224,8 +224,14 @@ ssh -o StrictHostKeyChecking=no ${master_host} mkdir -p ${master_status_dir} # start new distribution stats rsyncStart=`date +'%Y-%m-%d %H:%M:%S'` +if [[ "${OS}" == "Darwin" || "${OS}" == "FreeBSD" ]] +then + startTimestamp=`date -j -f '%Y-%m-%d %H:%M:%S' "$rsyncStart" +'%Y%m%d-%H%M%S'` + rsyncStartSec=`date -j -f '%Y-%m-%d %H:%M:%S' "$rsyncStart" +'%s'` +else startTimestamp=`date -d "$rsyncStart" +'%Y%m%d-%H%M%S'` rsyncStartSec=`date -d "$rsyncStart" +'%s'` +fi startStatus="rsync of `basename ${name}` started:$startTimestamp" echo ${startStatus} > ${solr_root}/logs/snappuller.status pushStatus @@ -236,8 +242,14 @@ ${stats} rsync://${master_host}:${rsyncd_port}/solr/${name}/ ${data_dir}/${name} rc=$? rsyncEnd=`date +'%Y-%m-%d %H:%M:%S'` +if [[ "${OS}" == "Darwin" || "${OS}" == "FreeBSD" ]] +then + endTimestamp=`date -j -f '%Y-%m-%d %H:%M:%S' "$rsyncEnd" +'%Y%m%d-%H%M%S'` + rsyncEndSec=`date -j -f '%Y-%m-%d %H:%M:%S' "$rsyncEnd" +'%s'` +else endTimestamp=`date -d "$rsyncEnd" +'%Y%m%d-%H%M%S'` rsyncEndSec=`date -d "$rsyncEnd" +'%s'` +fi elapsed=`expr $rsyncEndSec - $rsyncStartSec` if [[ $rc != 0 ]] then