delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/08/26/17:38:30

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>,
<http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
From: "Ryan McFall" <mcfallry AT cps DOT msu DOT edu>
To: <cygwin AT sourceware DOT cygnus DOT com>
Subject: rsync, ssh and cron
Date: Thu, 26 Aug 1999 17:32:24 -0400
Message-ID: <000001bef00a$7cd7a8c0$51310923@mcfallry.msu.edu>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4
Importance: Normal

Hi:

I apologize in advance for how long I'm sure this message will turn out to
be.

I am attempting to use rsync to backup some files from my home machine to a
server at night.  This is scheduled using cron, and rsync is using ssh as
its means of connecting to the server.

I have gotten to the point where I can get cron to start up rsync, which
will also then start up an ssh session.  I see my modem lights flash for a
while, and then the ssh process becomes <defunct>, leaving rsync taking up
most of my CPU cycles but obviously making no progress.

I am using RSA authentication with ssh.  After a bit of fooling around, I
figured out that I had CYGWIN32 set in my user environment to "tty binmode"
but not in the system environment.  Even though the cron service is running
as my account, it appears that it doesn't inherit my environment.  This was
causing the read of my identity file to fail.  Ok, sensible enough, I fixed
this by setting CYGWIN32 in the system environment.

Now comes the interesting part.  I decided to test by having cron start up
an xterm, using the command "xterm -display localhost:0".  This had worked
before setting CYGWIN32 in the system environment.  After making the change,
it no longer worked.  So, I took CYGWIN32 back out of the system
environment, and set it in my .bashrc file, which I then sourced in the
script that I am running that invokes rsync.  Now starting an xterm from
cron works again.

So, in that xterm (which should have the same environment as rsync script),
I execute the script.  It works perfectly.

However, it still doesn't work to invoke the script directly from cron.  The
only thing that I can think of that is different is that there is a terminal
associated with the xterm, but there isn't when the script is being run from
cron.  So, from cron, I executed xterm -display localhost:0 -e rsync.script.
This worked just fine.  So perhaps my theory was correct.

So, now that I've got something that works, I should just be happy, right?
But no, I want to know why it works.  Does anyone know what the problem is
here, and if so, how it might work to do this from within cron without
popping up a spurious xterm?

Thanks,
Ryan McFall
mcfallry AT cse DOT msu DOT edu


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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