Closed Thread
Results 1 to 3 of 3
Like Tree3Likes
  • 1 Post By trendsenv44
  • 1 Post By garrettroyce
  • 1 Post By descalzo

Thread: Cronjob does not run on my account

  1. #1
    trendsenv44 is offline x10Hosting Member trendsenv44 is an unknown quantity at this point
    Join Date
    Mar 2011
    Posts
    1

    Cronjob does not run on my account

    Hello x10 administrator,

    I have registered today with the following subdomain trendenv.x10.mx

    I have set an Cron Email, and I have created a PHP script, and set the following cronjobs:
    There are six cronjobs because they are all not working.
    • 25 * * * * /usr/bin/php /home/trendenv/public_html/{script}.php
      10 * * * * /usr/bin/php /home/trendenv/public_html/{script}.php
      35 * * * * /public_html/{script}.php
      5 * * * * /usr/bin/php /public_html/{script}.php
      45 * * * * /usr/local/bin/php /home/trendenv/public_html/{script}.php
      55 * * * * php /home/trendenv/public_html/{script}.php

    As you see, much to much cronjobs, but they arent working. I need just one. I have literally tried all suggestions about cronjobs I have found on this forum. Also I have Googled for it. I think there must be something wrong with the Cron Job permissions?
    (I read about permissions on the forum)

    Thank you!

    Kind regards,

    Trend
    Last edited by trendsenv44; 03-31-2011 at 01:17 PM. Reason: Edit the list
    dinomirt96 likes this.

  2. #2
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: Cronjob does not run on my account

    Try using wget instead of php.

    Code:
    wget -O - -q -t 1 "http://yourdomain.example/path/to/file.php"
    I think the method you are using now will work if you add -q, but I would think wget is the preferred way since the environment is CGI mode and not CLI, which most users are not familiar with and may cause problems because environmental variables are not set the same, amongst other things.

    Code:
    /usr/bin/php -q /home/user/public_html/path/to/file.php
    verlmirt17 likes this.
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  3. #3
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,635

    Re: Cronjob does not run on my account

    1. The email notification system has been disabled because an email for a 5 minute cron times thousands of accounts would bog down the mail server

    2.

    Code:
    /usr/bin/php /home/igor/public_html/cron_script.php >>/home/igor/public_html/cron_log.txt 2>&1
    will run the script and put any output (echo, print, system errors, etc) into the log file that you can check.

    This also allows you to put the script in a directory that is not accessible from the web, for security (once you have checked and debugged it. Being able to run it from the web is a good debugging tool).

    3. mail() in the above manner fails. Possibly due to being run via command rather than via Apache. Have not checked it using wget.
    Last edited by descalzo; 03-31-2011 at 07:47 PM.
    karimirt47 likes this.
    Nothing is always absolutely so.

Closed Thread

Similar Threads

  1. Please HELP how to use cronjob
    By vhadz in forum Programming Help
    Replies: 2
    Last Post: 05-28-2010, 08:55 AM
  2. Why use cronjob
    By centbux in forum Free Hosting
    Replies: 1
    Last Post: 10-20-2008, 04:47 PM
  3. CronJob Command Help
    By nokelt in forum Programming Help
    Replies: 2
    Last Post: 05-06-2008, 01:09 AM
  4. cronjob won't run
    By stocks in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 04-11-2008, 08:04 PM
  5. Cronjob
    By yuriman in forum Free Hosting
    Replies: 3
    Last Post: 03-23-2008, 05:08 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers