Win2k Scheduler not able to execute rsync over SSH

Chao,Eisen R. Eisen.Chao at cna.com
Thu Nov 20 08:56:17 EST 2003


Hi All:

This seems to work for my W2K environment.

1) CYGWIN has a definite problem w/ terminating sessions.
   If you look on various rsync forums, CYGWIN isn't closing
   some of its loose-ends properly.

2) I have rsync and passwordless authentication working under W2K.
   Within Task Scheduler I run a rsync .bat file, I also specify
   that the TS terminates the rsync job (which it must do because
   of 1) within 1 hrs time. Inside of the .BAT file, I need to set
   up the following MS-DOS environment variables, for the W2K
   account 'rsync':

      @set HOME=E:\home\rsync
      @set HOMEPATH=E:\home\rsync
      @set USERNAME=rsync

   As well as:

      e:\home\rsync\.ssh
      e:\home\rsync\.ssh\identity.pub

   This will allow your Admin account to set up scheduled tasks
   that can run as a non-admin account.

3) I also test ssh beforehand to make sure it works. I had problems
   talking to servers that use SSH protocl 1. Under W2K, set up a 
   test ssh script something like:

      @set HOME=E:\home\rsync
      @set HOMEPATH=E:\home\rsync
      @set USERNAME=rsync
      ssh -p 2245 -1 rsync at someserver-A

4) Because of 3) the rsync script looks like this:

      @set HOME=E:\home\rsync
      @set HOMEPATH=E:\home\rsync
      @set USERNAME=rsync
      rsync -av -e "ssh -p 2245 -1" rsync at sch1p115:/somepath-A/
E:\somepath-B

   No need to use the '-i' option to force it to use an alternate key
file.
   The excludes option is working great.

5) On some servers, the rsync modules feature isn't working (I dunno
why).
   Also my ~/.ssh/known_hosts file is sometimes at odds w/ its
counterpart file 
   on the remote, delete remote entry within your local file and do
another .ssh
   connect to regenerate known_hosts entry for the remote.

6) My W2K server is *NOT* an SSH server, that's a whole nuther topic. It
instead
   is an ssh & rsync client.

-----Original Message-----
From: rsync-bounces+eisen.chao=cna.com at lists.samba.org
[mailto:rsync-bounces+eisen.chao=cna.com at lists.samba.org] On Behalf Of
Jim Salter
Sent: Wednesday, November 19, 2003 3:35 PM
To: rsync at lists.samba.org
Subject: Re: Win2k Scheduler not able to execute rsync over SSH


> I set up my pub rsa id and all that stuff.
>
> My problem is here:
> I have a batch file which logs itself. The batch file contains some
logging commands and
> rsync -avze ssh user at server:/directory/. /local_dir
>
> This command is executed fine at the command prompt. (Doesnt ask for
password or passphrase as it is all setup.)
>
> when I execute this batch file thorugh the Win2K Task scheduler all 
> the
other commands in the batch file are
> executed except the above command. Dont know why.

Most likely the problem is that the Task Scheduler is executing your
batch file under a different user context than the one in which you are
executing it from the command line.  Remember that cygwin's openssh
looks for public keys under the user profile for whichever user context
is currently relevant - so if for instance Task Scheduler is operating
as LocalSystem and you published your SSH keys as Administrator, you
will have no joy in your automated SSH task.

Hope that helped.

Jim Salter
JRS Systems

-- 
To unsubscribe or change options:
http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html



More information about the rsync mailing list