| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Account Closed | Running a PHP file in Cron Job Hi Does anyone know how to run a php file in cron job every hour? what is the command i put in the cron job? right now i have the following and it does not work 55 * * * * php q- /home/play/public_html/cron.php What is the right command for this? Thanks |
| |
| | #3 (permalink) |
| NamePros Regular | Your cron entry is generally right. That way it will run the command hourly five minutes before the full hour. If it doesnt work nonetheless, your user is either not allowed to run cron jobs or the command cannot be executed. It is better to use absolute paths like /path/to/the/php/directory/php -q /path/to/script.php
__________________ Paris loves CityPics muov.com • qeww.com • sejz.com • viuo.com • vuav.com • wzeo.com • xeib.com • xueo.com -- Do not let others be treated this way! |
| |
| | #5 (permalink) |
| NamePros Regular | There is no other to use. Given your user has cron rights, your problem is mostly the non-absolute path. Modify it as I mentioned it previously and it should work.
__________________ Paris loves CityPics muov.com • qeww.com • sejz.com • viuo.com • vuav.com • wzeo.com • xeib.com • xueo.com -- Do not let others be treated this way! |
| |
| | #7 (permalink) | |
| NamePros Regular | Quote:
__________________ Paris loves CityPics muov.com • qeww.com • sejz.com • viuo.com • vuav.com • wzeo.com • xeib.com • xueo.com -- Do not let others be treated this way! | |
| |
| | #8 (permalink) | ||||
| NPQ's PA, Slave, and On Call Coder Technical Services | Quote:
Quote:
Quote:
Quote:
__________________ | ||||
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |