PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Try It Free
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
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  
Old July 21st, 2002, 07:28 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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

Reply With Quote
  #2  
Old July 21st, 2002, 10:05 AM
EvilivE EvilivE is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Milwaukee, WI USA
Posts: 291 EvilivE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via Yahoo to EvilivE
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.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > php and crontab


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway