Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
SuSE 9.1
Description
In snappuller, the output of $(date) is fed back into "date -d", which doesn't work in some (non-US) locales:
> date "-d$(date)"
date: ungültiges Datum ,,Fr Feb 2 13:39:04 CET 2007"
> date "d$(date +'%Y%m-%d %H:%M:%S')"
Fr Feb 2 13:39:10 CET 2007
This is the fix:
— snappuller (revision 1038)
+++ snappuller (working copy)
@@ -214,7 +214,7 @@
ssh -o StrictHostKeyChecking=no ${master_host} mkdir -p ${master_status_dir}
- start new distribution stats
-rsyncStart=`date`
+rsyncStart=`date +'%Y-%m-%d %H:%M:%S'`
startTimestamp=`dated "$rsyncStart" +'%Y%m%d%H%M%S'`
rsyncStartSec=`date -d "$rsyncStart" +'%s'`
startStatus="rsync of `basename ${name}` started:$startTimestamp"
@@ -226,7 +226,7 @@
${stats} rsync://${master_host}:${rsyncd_port}/solr/${name}/ ${data_dir}/${name}-wip
rc=$?
-rsyncEnd=`date`
+rsyncEnd=`date +'%Y-%m-%d %H:%M:%S'`
endTimestamp=`date d "$rsyncEnd" +'%Y%m%d%H%M%S'`
rsyncEndSec=`date -d "$rsyncEnd" +'%s'`
elapsed=`expr $rsyncEndSec - $rsyncStartSec`