Cron Help

They have: 71 posts

Joined: Mar 2004

I don't understand the concept of cron. I thought it would run a file at intervals I choose, but when I run a file that is supposed to add an entry to my mysql database, it gives me this error:

/home/blabla/public_html/blabla/idupdater.php: line 1: ?php: No such file or directory
/home/blabla/public_html/blabla/idupdater.php: line 3: syntax error near unexpected token `"config.php"'
/home/blabla/public_html/blabla/idupdater.php: line 3: `include_once("config.php");'

Anyone know what I'm doing? I sure don't.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

What's the code in your script?

Busy's picture

He has: 6,151 posts

Joined: May 2001

is your config.php file in the same as the cron file? if not put the path to the config in the include

They have: 12 posts

Joined: Dec 2004

Are you sure you have the right header in your file

eg
#! /usr/bin/php -q

They have: 71 posts

Joined: Mar 2004

Thanks grinchy!!! I had a typo in the header.

They have: 12 posts

Joined: Dec 2004

glad to help

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.