delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/11/20/03:45:43

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=3.4 required=5.0 tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,FORGED_YAHOO_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_PASS,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Raman Ravi <swcritic AT yahoo DOT com>
Subject: Re: Problem with date after date is modified in scripts
Date: Sat, 20 Nov 2010 08:45:16 +0000 (UTC)
Lines: 48
Message-ID: <loom.20101120T094147-336@post.gmane.org>
References: <loom DOT 20101113T105526-546 AT post DOT gmane DOT org> <20101118114506 DOT GE18309 AT calimero DOT vinschen DOT de> <loom DOT 20101118T141141-571 AT post DOT gmane DOT org>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Raman Ravi <swcritic <at> yahoo.com> writes:

> 
> Corinna Vinschen <corinna-cygwin <at> cygwin.com> writes:
> 
> > 
> 
> > > WOuld appreciate some help in understanding and more importantly resolving
> > > this issue.
> > 
> > This is a shortcoming in Cygwin itself.  You can only workaround it
> > by setting the date from a Cygwin process for now.  This will only
> > affect Cygwin processes running in the same user session, though.
> > There's a TODO in the affected code in Cygwin which describes this
> > very problem.  Unfortunately this requires a redesign of the code
> > in question...
> > 
> > Corinna
> > 
> 
> Hi Corinna,
> 
> Thanks for the reply (and information). I guess I have to retrieve the time
> using a "windows call" from my TMSERVER and then set the date/time back using
> date command in shutdown.sh
> 
> Thanks.
> Raman
> 
> 

Have a goofy solution but it works (if anybody else is interested)

1. Create a script to get the time string

getTimeStr

#!/bin/sh
net time "\\\\$TMSERVER"

2nd shell script "syncTime" contains

#!/bin/sh
TMSTR=`getTimeStr | grep Current | awk '{print $6,$7,$8}'`

date +"%m/%d/%Y %H:%M %p" -s "$TMSTR" >> $REG_DEV_NULL




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019