Results 1 to 3 of 3
Hi to all.
I want to run a php file through crontab.
I know some basic things about cron.but need some more details.
I have a dedicated server for one ...
- 06-20-2008 #1Just Joined!
- Join Date
- Jun 2008
- Posts
- 2
setting up cron to run php files
Hi to all.
I want to run a php file through crontab.
I know some basic things about cron.but need some more details.
I have a dedicated server for one of my client running Debian on it.
I want to run a php script where it will update some database tables in a 10 or 5 min interval of time. the best bet here is to run that script through crontab.
i know it will be something like this:
but now how could i setup this cron file to run properly.10 * * * * /usr/local/bin/php /var/www/html/cron.php
And is the above command is right and will work.
how to run cron under a normal user,mean to create a file like cron.allow OR cron.deny
Any details will be appreciated.
Thanks
- 06-20-2008 #2Linux User
- Join Date
- Jun 2007
- Posts
- 318
The cron file is the crontab. You edit the file with the command:
It'll put you in your default editor. The command you gave:Code:crontab -e
is wrong. It'll run at 10 minutes after the top of each hour (ex 2:10, 3:10, 4:10, etc). What you want is:10 * * * * /usr/local/bin/php /var/www/html/cron.php
This says to run at minute 0 and step in 10 minute intervals. Look at the manpage for crontab for details:0-59/10 * * * * /usr/local/bin/php /var/www/html/cron.php
You shouldn't have to do anything with cron.allow or cron.deny. I believe the default is to allow all users to set up crontabs.man 5 crontab
- 06-21-2008 #3Just Joined!
- Join Date
- Jun 2008
- Posts
- 2
Thanks vsemaska.
I was aware of that to setup mins.
Also i think we can put like */10.It will run after 10 min every hour.
i will try your solution as you mention.
I tried it also from some sources of google.but i think the problem was coming from PHP execution directory.
I am going to try on other linux distro.
Hope it will work.
Thanks buddy for your time.


Reply With Quote