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]

RE: cygwin cron


Smithesh,

The fact that scp works for you from the command line doesn't necessarily
mean it will work from cron.  Ssh and scp look in $HOME/.ssh for public
keys.  Cron runs as SYSTEM, with a blank (or default) environment.  Even
if you set the effective uid to you (which you actually may not be doing,
from what I could see), scp will not know where to look for the public
keys if $HOME is not set to your home directory, and therefore will not
try to authenticate you.  Please make sure that 1) cron switches to your
uid, and 2) your $HOME is set correctly.  You can do that by scheduling an
appropriate shell script to run through cron.  If this is indeed your
problem, you could define the appropriate environment before running scp
in your perl script (or a shell script).
	Igor

On Mon, 21 Oct 2002, Smithesh Ramachandran wrote:

> Thanks. I did look at the FAQ s'.  I haven't seen any of these specifics.
>
> I'm trying to scp files through cygwin cron (running on windows 2000) to
> Linux(redhat 72 kernal 2.4.7-10). And I'm running linux on pIII.
>
> The open_ssh version on Linux is OpenSSH_2.9p2. And I run sshd on linux on
> ports 9989 through 9999 (i'm not using the default port 22). The version on
> Cygwin is OpenSSH_3.4p1. I don't think the problem is with ssh/scp. Because
> it works fine on cygwin, and I'm able to scp files without giving
> passphrases (but using dsa public/private keys). But scp itself is not
> working through cygwin cron.
>
> I have done the following to install and start:
>
> $cygrunsrv -I cron -p /usr/sbin/cron -a -D
> $cygrunsrv -S cron
>
> Did the following on permission:
> $ chmod 1777 /var/cron
> $ chmod 1777 /var/cron/tabs
>
>
> Cron is running : (see below)
> $ ps -ef|grep cron
>   SYSTEM     536    1336   ?  10:24:55 /usr/sbin/cron
>
> Attaching the output for cygcheck -r -s -v
>
> Please let me know if you need anything more.
>
> Thanks,
> Smithesh.
>
>
> -----Original Message-----
> From: lhall@pop.ma.ultranet.com [mailto:lhall@pop.ma.ultranet.com]
> Sent: Monday, October 21, 2002 3:21 PM
> To: smithesh@ticketmaster.com; maharig@idirect.net; cygwin@cygwin.com
> Subject: RE: cygwin cron
>
>
> I'm afraid that what you've provided only tells us what you're
> doing and how you're doing it.  Unfortunately, we don't know anything
> else about your system or your setup.  Make sure you've reviewed the
> email archives for cron issues and resolutions and that you've reviewed
> the cron and login READMEs (at least) as well as the user guide
> (particularly
> the stuff on permissions if you're running NT/W2K/XP).  Oh, and a review of
> the FAQ may be worthwhile as well.  You never know what tid-bits are lurking
> in the answers to even seemingly unrelated questions.  If you don't find
> something useful in all that which resolves your problem, please provide
> the output of cygcheck -s -r -v as an attachment as well as the steps you
> took to configure cron to the list.  Someone may be able to spot your
> problem given that.
>
> Good luck,
>
> Larry
>
> Original Message:
> -----------------
> From: Smithesh Ramachandran smithesh@ticketmaster.com
> Date: Mon, 21 Oct 2002 13:53:12 -0700
> To: maharig@idirect.net, cygwin@cygwin.com
> Subject: cygwin cron
>
>
> Hi ,
> I'm trying to scp (without pass phrases) using dsa on cygwin cron.
> scp works fine, but not within cron.
>
> this is what I'm doing -
>
> crontab -e
>
> 00 * * * * /usr/bin/perl /home/admin/perl/test.pl  >>  /tmp/test.txt
>
> and this is what test.pl has:
>
> #!/usr/bin/perl
>
> system('scp -P 9989 -oProtocol=2 -r /cygdrive/b/IN
> smithesh@172.26.20.34:tmp/.');
>
> When I run test.pl by itself on cygwin command line, it works (meaning
> it does the scp),  but not within cron.
>
> Also tried putting scp stmt itself within cron and didn't work either.
> I also tried removing, installing, stopping and starting cron using
> cygrunsrv.  cron in general works, but is not doing the above scp stuff.
> I'm not sure if I'm doing anything wrong..  Help..
> Thanks,
> Smithesh.

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Water molecules expand as they grow warmer" (C) Popular Science, Oct'02, p.51


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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]