Cron Job

Cron Job

Posted by: kton
Posted on: 2004-04-10 03:32:00

OK well , yea Noob here ,
anyways
im trying to set up a cronjob for a cgi script that auto updates the unbuilt news on my page.
anyways
in shell im typing
eg
* * * * * /home/ktonix/ktonix.com/kpanel/autobuild.cgi?full

it returns
bash: Maildir: command not found
what am I doing wrong?

Re: Cron Job

Posted by: ardco
Posted on: 2004-04-10 05:21:00

First, you need to use the crontab command (do "man crontab" and "man 5 crontab" for more info).

I like to put my schedule lines into a file, like called cron-table or similar, and then do:

crontab cron-table

2nd, Does it really need to run every minute?

Good luck,

BobS

Re: Cron Job

Posted by: Atropos7
Posted on: 2004-04-10 05:37:00

In reply to:


in shell im typing
eg
* * * * * /home/ktonix/ktonix.com/kpanel/autobuild.cgi?full


The shell ain't a web server ;)

The ?full stuff is CGI and the shell doesn't do CGI, the web server does. What the web server does is set the value of the QUERY_STRING to "full" and then run the program, where the program or script actually reads the environment variable.

What you want to do in crontab is pass command-line paramters which is a wholly different method, and possibly not supported by your CGI script.

So what you need to do is hack the script to read command-line parameters.

In Perl, they are in the @ARGV array.

Oh, and from the shell you do:

/home/ktonix/ktonix.com/kpanel/autobuild.cgi full

You're not supposed to put the crontab stuff in front of the command in the shell.



cool Perl / MySQL / HTML CSS

Re: Cron Job

Posted by: kton
Posted on: 2004-04-11 12:37:00

Ok thx , I figured it out :)
Found out the the cgi script has a few bugs , so I might not run it after all

Tags: cgi scriptcron jobnoobyeatypingshell