Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Putting a PHP script into Cron

Status
Not open for further replies.

kapok2002

Programmer
Aug 14, 2000
8
US
I need a PHP script put into Cron.&nbsp;&nbsp;How do I make Cron accept PHP?<br>
 
Please explain what you mean by put a PHP scrip in cron.<br><br>crontab files use standard shell script.&nbsp;&nbsp;But each entry can call any executable file on the system.&nbsp;&nbsp;It's not always a good idea but it can.<br><br>If you want to run a PHP script at a certain time type <br><br>crontab -e <br><br>and add the line <br><br>* * * * * /directory/file.php<br><br>Read the crontab man file 'man 5 crontab' to see what each of the stars must be replaced with.<br><br>Also if you look at the crontab it will have a mailto entry in the beginning.&nbsp;&nbsp;This is the user who will get an email with any output from the program that is run.&nbsp;&nbsp;If you want to minimize the output you may want to add <br><br>2&gt; /dev/null &gt; /dev/null <br><br>so any output goes directly to /dev/null avoiding 4000 message in roots email over a period of a week. :)<br><br>Good luck<br><br>-cm<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top