delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/06/22/10:26:56

X-Spam-Check-By: sourceware.org
Date: Thu, 22 Jun 2006 10:26:30 -0400 (EDT)
From: Igor Peshansky <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: "G.W. Haywood" <ged AT jubileegroup DOT co DOT uk>
cc: cygwin AT cygwin DOT com
Subject: RE: 1.5.19: tar runs normally from command line but terminates early when run from crontab
In-Reply-To: <Pine.LNX.4.58.0606221421560.31140@mail3.jubileegroup.co.uk>
Message-ID: <Pine.GSO.4.63.0606221022300.10500@access1.cims.nyu.edu>
References: <BD6B3BD6A3C3EC4FBC45FF024CE104370276B3AA AT WAPRDVSEBE10 DOT gsm1900 DOT org> <Pine DOT LNX DOT 4 DOT 58 DOT 0606221421560 DOT 31140 AT mail3 DOT jubileegroup DOT co DOT uk>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

On Thu, 22 Jun 2006, G.W. Haywood wrote:

> Hi Eric, Charles,
>
> Thanks for the help guys, that got me going in the right direction.
>
> On Mon, 19 Jun 2006, Eric Blake <ebb9 AT XXX DOT XXX> wrote:

<http://cygwin.com/acronyms/#PCYMTNQREAIYR>.  Thanks.

> > According to G.W. Haywood on 6/19/2006 3:53 AM:
> >
> > > When run from the command line the job works ... and when run from
> > > the crontab it fails...
> >
> > It's probably a bug in your cron setup, rather than a bug in tar.  Have
> > you run cron-diagnose?  Can you get simpler cron tasks to work?  Remember
> > that cron is run as a different user than the normal command line, so
> > permissions do play a role on what the cron script can do.
>
> The cron instance was running as the same user that could successfully
> run the tar job from the command line, so it wasn't permissions, but I
> think you're right, Eric, about it being the cron setup.  I think that
> the problem is there's no MTA running on the box.  Even though there's
> no mail to be sent by cron it seems to be trying to connect to an MTA
> before finding that there's no mail to send.  Unfortunately, when it
> finds there's no MTA it terminates the job.  (If I had syslog running
> it might tell me... :)

Check the Windows event log.  Or install a syslog daemon (Cygwin has 2 --
the original syslog in inetutils, and syslogng in syslog-ng).

> When I redirected tar's stdout (as well as the existing redirection of
> its stderr) to a file, the tar job in the crontab ran to completion.

Yes, cron will try to email you the output of a job if it's not redirected
into a file, even if the output is empty.

> Funny thing is, I'm sure I have several Linux machines kicking around
> which are running jobs from crontabs but not running MTAs.  I'd better
> check that, I suppose...

You don't need to *run* an MTA, only to have an MTA installed (e.g.,
sendmail).  FWIW, Cygwin has a few MTAs that you can use (ssmtp, exim).

> On Wed, 21 Jun 2006, Stepp, Charles wrote:
>
> > running from cron does not set the environment the same as with an
> > interactive session.
>
> Charles, I was pretty sure that it wasn't an environment problem as
> the command shouldn't be relying on anything in the environment for
> its execution (sure, you never know until you try:).

Well, if your cron job says "tar" instead of "/usr/bin/tar", you're
relying on the environment.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

--
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