delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/06/22/09:45:28

X-Spam-Check-By: sourceware.org
Date: Thu, 22 Jun 2006 14:44:31 +0100 (BST)
From: "G.W. Haywood" <ged AT jubileegroup DOT co DOT uk>
To: Eric Blake <ebb9 AT byu DOT net>, "Stepp, Charles" <Charles DOT Stepp AT T-Mobile DOT com>
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: <BD6B3BD6A3C3EC4FBC45FF024CE104370276B3AA@WAPRDVSEBE10.gsm1900.org>
Message-ID: <Pine.LNX.4.58.0606221421560.31140@mail3.jubileegroup.co.uk>
References: <BD6B3BD6A3C3EC4FBC45FF024CE104370276B3AA AT WAPRDVSEBE10 DOT gsm1900 DOT org>
MIME-Version: 1.0
Received-SPF: pass (mail3.jubileegroup.co.uk: localhost is always allowed.) receiver=mail3.jubileegroup.co.uk; client-ip=127.0.0.1; helo=mail3.jubileegroup.co.uk; envelope-from=ged AT jubileegroup DOT co DOT uk; x-software=spfmilter 0.93 http://www.acme.com/software/spfmilter/;
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.6 (mail3.jubileegroup.co.uk [0.0.0.0]); Thu, 22 Jun 2006 14:44:39 +0100 (BST)
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

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 byu DOT net> wrote:

> 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... :)

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.

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

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:).

Thanks again for the help.

73,
Ged.

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