delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/06/30/07:50:40

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Reply-To: =?iso-8859-1?Q?Rom=E1n_Medina?= <roman AT optenet DOT com>
From: "roman_listas optenet" <roman_listas AT optenet DOT com>
To: <cygwin AT cygwin DOT com>
Subject: Script .bat launched before login to Windows
Date: Mon, 30 Jun 2003 13:48:48 +0200
Message-ID: <004d01c33efd$92971a10$4603a8c0@roman>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Importance: Normal
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id h5UBodK30694

Hi,

I've created a script to do some ftp mirroring (by using rsync, through
ssh). The .bat works perfectly if launched from a Windows session
(logged as Administrator). Basically, the .bat is similar to cygwin.bat,
but I pass a .sh script to the last command (the bash statement) so the
sequence is:
- I invoke the .bat script
- this one invokes bash with finally executes .sh script

The .sh script basically launches a rsync -e ssh (client mode) against a
server running sshd. The authentication against ssh is transparently
done by public key authentication.

Well, as I said, this works if launched from a Windows session. Now, I
want to automatize this. For doing so, I've created an "at" entry for
user Administrator, so the .bat script is launched as that user every
day at a given time. Nevertheless, it doesn't work. I've had a look at
this, and the problem seems to be that .bat script lacks the environment
for Administrator, so it doesn't know where to look for the ssh key
necessary for auth. In other words, the .bat is being run without a
Windows session established so it cannot retrieve some data (I think
that's the problem).

My question is: which modifications should I have to do to my .bat
script so it could retrieve the correct environment for Administrator
account? Any idea? I tried to add a "set username=Administrator" to the
.bat script but it seems not to work. I'm quite lost here :-/. Please,
help.

Saludos,
-Román


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

- Raw text -


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