Date: Thu, 19 Mar 1998 17:23:13 +0000 From: Karl Pielorz <kpielorz@tdx.co.uk> To: isp@FreeBSD.ORG Subject: Problems with 'fetch'... Message-ID: <35115481.AA09D119@tdx.co.uk>
next in thread | raw e-mail | index | archive | help
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 >/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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?35115481.AA09D119>