Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    1
    cPanel/Enkompass Access Level

    Website Owner

    Default cron doesnt run correctly my php file

    hello, i have a serius problem with cron, when i run my php file manually from shell runs fine, but when i run from cron runs poorly, ive made a bash script to do this job.

    this is a extract of the code:

    -rit )
    cd /home/legalint/public_html/robot/
    php -f robot_LegalInt.php
    ;;

    so, when i call the script from shell robot -rit, says

    ---------------------------------------------------------
    C-4370-2009 | (Causa 1 de 291)
    Bytes Actuales: 480924
    Bytes en Bd: 480924
    CABELLO INMOBILIARIA BOS
    2 Juzgado Civil de Chillan
    ------------------------------------------------------------

    when i run this comand (robot -rit) from cpanel cron job, says

    ---------------------------------------------------------
    C-4370-2009 | (Causa 1 de 291)
    Bytes Actuales:
    Bytes en Bd: 480924
    CABELLO INMOBILIARIA BOS
    2 Juzgado Civil de Chillan
    ------------------------------------------------------------

    the Bytes Actuales: is empty...

    why works when i ran from shell directly, and doesnt work from cron?

    thanks

  2. #2
    Member
    Join Date
    Aug 2010
    Location
    India
    Posts
    238
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: cron doesnt run correctly my php file

    Hello,

    As what user you run it as cron; do you use the same user to try the script using command line? If not, su to the user you are using to run the cron and execute the script again from that user's shell.

    Thank you,
    Nibin.

  3. #3
    Support Manager cPanelEric's Avatar
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    488
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: cron doesnt run correctly my php file

    Howdy,

    Can you run the script as the user using?

    Code:
    php -f  /home/legalint/public_html/robot/robot_LegalInt.php
    You might need the path to php too.

    Thanks!

Similar Threads & Tags
Similar threads

  1. Restart Apache correctly from script file (via cron)
    By jameshurrell in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 08-15-2011, 02:35 PM
  2. Replies: 3
    Last Post: 03-29-2007, 04:31 AM
  3. How do i make a php file run as a cron?
    By Bidybag in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 05-18-2006, 02:18 PM
  4. how can i run a php file by Cron Manager
    By mahdionline in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 12-18-2005, 10:24 AM
  5. How do i run a PHP file with cpanels cron?
    By demine0 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 08-10-2003, 08:44 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube