Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-136

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.3
    • replication (scripts)
    • 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}

      1. 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`

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: