You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Bill Au (JIRA)" <ji...@apache.org> on 2007/07/17 14:55:05 UTC

[jira] Resolved: (SOLR-136) snappuller - "date -d" and locales don't mix

     [ https://issues.apache.org/jira/browse/SOLR-136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bill Au resolved SOLR-136.
--------------------------

    Resolution: Fixed

Patch commited.  Thanks Jürgen.

> snappuller - "date -d" and locales don't mix
> --------------------------------------------
>
>                 Key: SOLR-136
>                 URL: https://issues.apache.org/jira/browse/SOLR-136
>             Project: Solr
>          Issue Type: Bug
>          Components: replication
>         Environment: SuSE 9.1
>            Reporter: Jürgen Hermann
>             Fix For: 1.1.0
>
>
> 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=`date -d "$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`

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.