Re: [PBML] Perl & Cron Jobs
- From: Gordon Stewart <gordon52@...>
> Basically, If I run the script from the browser - It displays ok. If IWhat happens if you run the script from the shell?
> run it as a cron-job, it SHOULD record the same information, into the
> 1st log file (if any)
> If anyone understands cron jobs, & CGI scripts, can they please
> reply, advising that Im correct - or totally blind.
It waits for you to enter the query doesn't it? Maybe that's what
happens when you start the script via cron, it just sits there trying
to read from STDIN, doing nothing.
From the docs of CGI.pm:
If you are running the script from the command line or in the
debugger, you can pass the script a list of keywords or
pairs on the command line or from standard input (you don't have
worry about tricking your script into reading from environment
===== Jenda@... === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
- At 06:15 PM 8/31/03 +0200, Jenda wrote:
>What happens if you run the script from the shell?I guess my ISP / Host is having cron-job problems (the website says that
>It waits for you to enter the query doesn't it? Maybe that's what
>happens when you start the script via cron, it just sits there trying
>to read from STDIN, doing nothing.
cron-jobs are updated (to the main job list i guess) every hour..)
I came online a few days ago, & uploaded the test script etc..
& yesterday - the cron job (test script) - sucessfully started, (& is
still) merrily telling me the time - (in the log file) - every minute :)
Yesterday, I logged on, & uploaded my NEW / Correct cron job list..
& came home today & my old/test script is STILL telling me the time..
So Ive sent a message to 'admin' (support dont seem to know..) - Advising
how often cron jobs are updated
I guess nothing to do - but wait..
(anyone got a spare $2.5 million ? - ) - I'll buy my own ADSL / Cable - &
live off the interest - & run my site from home..
[Non-text portions of this message have been removed]
- --- In email@example.com, Gordon Stewart <gordon52@s...>
> My cron jobs have ceased to function, for almost a week :-(
> Hi there - Its been over 24 hours since I posted this script to my
> web forum, & ive had no responses (either telling me my script /cron job
> is correct, or if theyre not correct.)into the
> Basically, If I run the script from the browser - It displays ok.
> If I run it as a cron-job, it SHOULD record the same information,
> 1st log file (if any)But its
> If anyone understands cron jobs, & CGI scripts, can they please reply,
> advising that Im correct - or totally blind.
> PS - the directory name /www/g/gorstew/logs/ IS correct..
> Is this script correct ?
> Read carefully & follow instructions.
> in my
> /www/g/gorstew/etc/crontab file I have (ive split it into 3 lines,
> on 1 line) :-I still
> * * * * * /www/g/gorstew/cgi-bin/test/test1.cgi
> ok - The following script (in between the equals line) is my FULL
> the time is now :-
> US Naval Observatory Master Clock Time
> August 29, 13:13:05 UTC
> August 29, 09:13:05 AM E
> August 29, 08:13:05 AM C
> August 29, 07:13:05 AM M
> August 29, 06:13:05 AM P
> August 29, 05:13:05 AM Y
> August 29, 03:13:05 AM A
> Can anyone tell me if Im crazy, Or just plain blind
> I did upload this test yesterday - & found that after a few HOURS -
> had no cron-jobs.I think Jenda's response is probably spot on.
> Can anyone tell me what they think it will do (ESPECIALLY the log files)
> #use strict;
> use CGI::Carp qw(fatalsToBrowser);
> use CGI 'param';
> use CGI qw/:standard/;
> use CGI::Cookie;
> use lib './';
> #use lib '/www/g/gorstew/cgi-bin/groupmail/';
> print "Content-type: text/html\n\n";
> print "<HTML><BODY>\n";
> print "HELLO THERE MATE - $t\n";
> print "</BODY>\n</HTML>\n";
use CGI 'param';
use CGI qw/:standard/;
use CGI qw/ :standard param -no_debug /;
Why was 'use CGI' on two lines? Doesn't ':standard' include 'param'?
- --- In firstname.lastname@example.org, "Andi Permadi" <andi@a...> wrote:
> Hi All,I really shouldn't respond to this because if you did a bit of looking
> How to create Perl database link to MS-SQL 2000 Server ?
> Thankyou !!!
around you'd find the answer.
You can get it from: