1.5.19: tar runs normally from command line but terminates early when run from crontab

G.W. Haywood ged@jubileegroup.co.uk
Thu Jun 22 14:07:00 GMT 2006


Hi Eric, Charles,

Thanks for the help guys, that got me going in the right direction.

On Mon, 19 Jun 2006, Eric Blake <ebb9@byu.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/



More information about the Cygwin mailing list