[thelist] cron (specifically the cgi it runs)

Steve Cook sck at biljettpoolen.se
Thu Nov 16 04:34:41 CST 2000


Hi Adrian,

Line 5 of your script, you print our a Content Type header. What you'll need
to do is check whether your script is being called from cgi or from the
command line (the cron version) and make sure that nothing at all is printed
out for the cron version.

I think!

I didn't check the entire script to see exactly what is going on, but I'm
assuming it's a script that runs from either place - right? I have no perl
manual with me and have forgotten exactly how you tell where the script is
running from, but I'm sure that shouldn't be too hard to figure out! 

I've done a similar thing in one of my scripts - which is command-line only.
I can call it with an option from the command line that tells the script I
want to run it in debug mode where it prints out information useful for
debugging. Otherwise it has no output unless there's an error it should
report to me.

Good luck - I wish I could get over for that beer, it's cold and rainy here
in Sweden!

.steve


----------------------------------
   WapWarp - http://wapwarp.com
 Wap-Dev - http://www.wap-dev.net
 Cookstour - http://cookstour.org
----------------------------------

> -----Original Message-----
> From: Adrian Fischer [mailto:adrian at logo-logic.com]
> Sent: den 16 november 2000 11:07
> To: The List 
> Subject: [thelist] cron (specifically the cgi it runs)
> 
> 
> Greetings all,
> 
> Would appear I'm cap in hand again.
> 
> I am trying to get a cron to check my mail file (earlier 
> request this week).
> I had it working fine when it was part of my man script and 
> it did what I
> wanted. ie check email and when finding certain words would 
> update the db.
> Great stuff (and thanks to all).
> 
> I used the crontab article in the archives to sus out how to 
> do the crontab
> thing from telnet and I rehacked my mail check subs to make a 
> separate .cgi
> .  I even got it all installed and the cron actually ran the 
> script and
> continues to do so...
> 
> However (you just knew there had to be one..),  the only 
> reason I know the
> cron is working is because it sends me an error email every 
> time it runs
> (15min intervals).
> 
> This is what it barfs up"Content-type: text/html"
> 
> Now, I'm thinking that this shouldn't be in there anyway as 
> the script is
> not printing anything to the screen.  Its just supposed to 
> update the db and
> send some emails. If I run the cgi from my browser it doesn't 
> hic up.  But I
> can only  assume when its run as a cron that it shouldn't have the
> "Content-type: text/html" in it.
> 
> If I remove the offending bit of code it doesn't work at all 
> in fact it
> gives the dreaded 500 error message.  I checked the actual 
> autoresponder.cgi
> script in the archives and it doesn't have the "Content-type: 
> text/html" in
> it but that crashes my script as well.
> 
> As part of my main script it did exactly what I wanted but I 
> cant get the
> thing to work as a standalone with cron.
> 
> Feel free to have a look (and laugh) at my feeble attempts at 
> perl and sql
> (hey, what do you expect for only 8 weeks of db'ing)
> http://aussiebidder.com/emailcheck.txt
> 
> Thanks yet again.
> 
> If this thing ever fly's and your ever in down under the 
> beers are on me..
> 
> 
> Regards
> 
> Adrian
> 
> Oh..and rudy, thanks for the offer to check my joins out.  It 
> was only two
> tables and I got it working (its part of this thing)
> 
> 
> 
> 
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt ! 
> 




More information about the thelist mailing list