This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Script .bat launched before login to Windows


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]