X-Spam-Check-By: sourceware.org Date: Thu, 22 Jun 2006 14:44:31 +0100 (BST) From: "G.W. Haywood" To: Eric Blake , "Stepp, Charles" 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: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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 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/