From owner-freebsd-isp Thu Mar 19 09:23:31 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA26561 for freebsd-isp-outgoing; Thu, 19 Mar 1998 09:23:31 -0800 (PST) (envelope-from owner-freebsd-isp@FreeBSD.ORG) Received: from caladan.tdx.co.uk (caladan.tdx.co.uk [195.188.177.4]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA26543 for ; Thu, 19 Mar 1998 09:23:20 -0800 (PST) (envelope-from kpielorz@tdx.co.uk) Received: from tdx.co.uk (lorca-tx.tdx.co.uk [195.188.177.242]) by caladan.tdx.co.uk (8.8.7/8.8.7) with ESMTP id RAA05124 for ; Thu, 19 Mar 1998 17:23:14 GMT (envelope-from kpielorz@tdx.co.uk) Message-ID: <35115481.AA09D119@tdx.co.uk> Date: Thu, 19 Mar 1998 17:23:13 +0000 From: Karl Pielorz Organization: TDX X-Mailer: Mozilla 4.04 [en] (WinNT; I) MIME-Version: 1.0 To: isp@FreeBSD.ORG Subject: Problems with 'fetch'... Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I run a simple 'fetch' command from my crontab - It grabs a GIF status image from a server every half an our or so... Recently we've added 'basic' http authorization for this site, No problem I thought - after reading the man page for fetch, I modified our script so it does: HTTP_AUTH=basic:*:mstat:password; export HTTP_AUTH fetch -a -q -T 220 http://stats.dmpriest.com/router0.gif This falls over though... By logging the output - I find I get the following error: fetch: opening /dev/tty: Device not configured fetch: router0.gif: cannot authenticate with server stats.dmpriest.com It's almost like 'fetch' still thinks it's running from a tty, and not a non-tty script etc. I thought I'd get clever and put "/dev/null 2>&1" at the end of it, but it still gives the same error (even with that at the end of the fetch command, and the crontab command). So, I'm left thinking - either fetch is ignoring the environment variable (and trying to prompt the user for a username & password), or it doesn't notice the fact it's not running from a real tty - when being run by the cron. The cron jobs is set to run as user 'root', and the script is running '#!/bin/sh' as it's interpreter... If I log into the console and run the script manually - it runs fine, but not from from the Cron... I realise we could do this a different way - but the fetch command also provides a nice way of making sure the web server is 'still up' ;-) Can anyone suggest anything?? Thanks in advance, Karl Pielorz To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message