Crons PHP Scripts

Discussion in 'Installation/Configuration' started by msource, Mar 18, 2008.

  1. msource

    msource New Member

    Good Morning,

    Could some one tell me how can í put a php script that are in /var/www/web6/web/include/teste.php like a cron job? I need to run this script every 30 minuts.
     
  2. zcworld

    zcworld New Member

  3. msource

    msource New Member

    Hi, thanks for your quick reply.

    I try your solution, but the script don't work.
    Via http, by "hand" e run the script, but by the cron the script dont run.

    Is there any ideas?
     
  4. zcworld

    zcworld New Member

    try
    adding before the test.php

    /path/to/php /path/to/my/php.file.php

    but check to see if you need to use any switchs on the php

    php --help
     
  5. msource

    msource New Member

    Tanks again, fo scripts included in ISPConfig, they are like this:
    Code:
    /root/ispconfig/php/php /root/ispconfig/scripts/shell/logs.php &> /dev/null
    This scripts run over Apache 1, from ISPConfig.

    What are the path of php where the pages are running?
    Code:
    /etc/php5/apache2 
    Tanks for all the help.
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Run
    Code:
    which php
    to find out where the PHP binary is located.
     
  7. msource

    msource New Member

    Code:
    /usr/bin/php
    this is the path
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Put this in your crontab:
    Code:
    */30 * * * * /usr/bin/php /var/www/web6/web/include/teste.php
     

Share This Page