|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
php and crontab
hi,
could you tell me please how can i use crontab with php. steps to explain for me how and where to put the crontab. thanx |
|
#2
|
|||
|
|||
|
RE: php and crontab
I will try, I love using php this way.
crontab -l (displays what is currently in crontab) crontab -e (edit the current crontab, opens w/default editor) The syntax for cron is: minute|hour|day of month|month|day of week|command You need to make sure that you have access to cron. Check files /etc/cron.allow, /etc/cron.deny For more info on that check the man pages for crontab specifically crontab(1) and (5). Create a php file, ie cli.php, like you normally would (minus the html), make sure that it is executable. Then for the command part of crontab do something like this: php -q /path/to/file/cli.php Thats it! Here is an example of a statement in my crontab: 30 19 3 19 * php -q /home/evilive/icommish_jobs/48hrs.php This basically reads: On the 30th minute of the 19th hour on the 3rd day of the 9th month on any day of the week execute 48hrs.php Hope that helps. |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > php and crontab |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|