Solr
  1. Solr
  2. SOLR-136

snappuller - "date -d" and locales don't mix

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3
    • Component/s: replication (scripts)
    • Labels:
      None
    • Environment:

      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=`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`

        Activity

        Hide
        Bill Au added a comment -

        Patch commited. Thanks Jürgen.

        Show
        Bill Au added a comment - Patch commited. Thanks Jürgen.

          People

          • Assignee:
            Unassigned
            Reporter:
            Jürgen Hermann
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development