correct cronjob not working?

illutic

New member
Joined
Jun 24, 2006
Messages
2
Location
Enschede, the Netherlands
I've been trying to set up a correct cron job for several weeks now, but still haven't been able to make it work..
I've been browsing through these forums for a few hours, found somethings I could use, but the cronjob still isn't working..

There are three files I want to execute every hour/every several minutes. One file is for PHPAdsNew, and two are for my website (deleting sent pm's weekly and making sure users are offline in the db when their ip-address isn't in the current visitors table).

My cronjobs look kinda like this:

* * * * * /usr/local/lib/php /home/USER/domains/DOMAIN/cronjobs/cronjob.php

Ofcourse USER stands for my username and DOMAIN for the domainname.

As you can see the cronjob.php is outside of the public_html folder (I also got one running inside the public_html to view which one is working, but neither one of them works right now)..

As far as I know I'm not able to view the cron log (viewed my log folder, but there's no folder in it called cron, or files that are called anything with the word cron or cronjob in it) and my host doesn't support the cron jobs (the package details say I can use them, though).

I've added a line to this .php file to insert a timestamp into my cronjob table when this file has been called, but so far no inserts in that table yet. I've also changed the chmod of the cronjobs folder and the cronjob.php to 777. And I've obtained the php path with calling phpinfo().

I really don't understand why the cronjobs won't work and would really appreciate any help.
 
DirectAdmin Support said:
Hello,

/usr/local/lib/php

should be

/usr/local/bin/php

;)

John

Why would he have to prefix his cron job if its included in php.ini's include path?
 
pucky said:
Why would he have to prefix his cron job if its included in php.ini's include path?

The php.ini file is read by the php executable, if you can't find the executable there is no way for it to read the php.ini. That include_path is for locating php scripts not the executable.
 
You can do that like:

* */6 * * * here-the-location here-the-path-to-the-file

I know it's a topic from 2006 but this is for people who use the search button.
 
Sure, if you want the cronjob to run every minute of every sixth hour. If you want it to run every six hours, you need a single number in the minute column. For example, if you want the cronjob to run at 12:03 am, 6:03 am, 12:03 pm, and 6:03 pm.
Code:
3 */6 * * *
Jeff
 
Back
Top