Results 1 to 9 of 9

Thread: CRON question

  1. #1
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default CRON question

    I am trying to figure out why services set for automation aren't working.

    I know you don't do support for clientexec but any information would be appreciated.

    In the automation service it has an option of run from URL: yes or no

    and in the CRON (in cpanel) I have this command line:
    /usr/local/bin/php -q /home/myusername/public_html/hosting/services.php 'rebiller'
    (I have the username actually in there).

    In their support forum it says you can run it from URL by this:
    http://www.mydomain.com/hosting/services.php?=rebiller

    which works if I throw that in the address bar of my browser and I have the run from URL to yes.

    I don't get the whole CRON stuff, but the support staff said my run setting look correct as far as time, day, etc...
    Thank you,
    Lynne Hanson
    RL Hanson-Online

  2. #2
    Matt's Avatar
    Matt is offline GlowHost Administrator
    Join Date
    Jan 2005
    Location
    Behind your monitor
    Posts
    6,219

    Default

    What happens when you run this from the command line?

    php /home/myusername/public_html/hosting/services.php 'rebiller'

    If that works, use the above line in your cron instead.
    Send your friends and site visitors to GlowHost and get $125 plus bonus!
    GlowHost Affiliate Program | Read our Blog | Follow us on X |

  3. #3
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default

    php /home/myusername/public_html/hosting/services.php 'rebiller'
    I guess I don't get it. I updated the cpanel CRON to this and changed the setting to match the time in the automation part of CE, it is set to run around midnight so we'll see.
    I submitted a trouble ticket with the response from CE support staff also.

    edit: I take that back... this is the response I got via email:

    Status: 404 Not Found
    X-Powered-By: PHP/5.2.11
    Content-type: text/html
    No input file specified.
    Last edited by rlhanson; 01-29-2010 at 11:11 PM. Reason: update
    Thank you,
    Lynne Hanson
    RL Hanson-Online

  4. #4
    Matt's Avatar
    Matt is offline GlowHost Administrator
    Join Date
    Jan 2005
    Location
    Behind your monitor
    Posts
    6,219

    Default

    Well the other option if you can call the script in a browser is to make your cron command like:

    That assumes no password is needed to call the script.
    Send your friends and site visitors to GlowHost and get $125 plus bonus!
    GlowHost Affiliate Program | Read our Blog | Follow us on X |

  5. #5
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default

    Is that what I put in the CRON command area of cpanel? I have the option of turning on run from URL in CE... would I enable that also?

    Will I get an email telling me that it has ran even if there aren't any invoices generated? Because I think I had the "username" wrong, and updated it but haven't gotten an error or anything yet. Does that mean it ran?
    Thank you,
    Lynne Hanson
    RL Hanson-Online

  6. #6
    Matt's Avatar
    Matt is offline GlowHost Administrator
    Join Date
    Jan 2005
    Location
    Behind your monitor
    Posts
    6,219

    Default

    Quote Originally Posted by rlhanson View Post
    Is that what I put in the CRON command area of cpanel? I have the option of turning on run from URL in CE... would I enable that also?
    That is the command to run via cron. So yes, put GET and a space, and then the URL as I made an example above.

    Quote Originally Posted by rlhanson View Post
    Will I get an email telling me that it has ran even if there aren't any invoices generated?
    I don't know, in theory yes you should unless you add some additional arguments to the command above with will disable all emails or only email if there is an error, but...there are several factors that could make that not happen. The first being you didnt set the cron job up to email you.

    Quote Originally Posted by rlhanson View Post
    Because I think I had the "username" wrong, and updated it but haven't gotten an error or anything yet. Does that mean it ran?
    I don't know what you mean about a username, since there are only about a million places I can think of where a username would go, or how a username could be used. If I knew more about what you mean perhaps I have an answer.
    Send your friends and site visitors to GlowHost and get $125 plus bonus!
    GlowHost Affiliate Program | Read our Blog | Follow us on X |

  7. #7
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default

    Quote Originally Posted by Matt View Post

    I don't know what you mean about a username, since there are only about a million places I can think of where a username would go, or how a username could be used. If I knew more about what you mean perhaps I have an answer.
    I mean I'm brain dead and pasted the line you had on there with "myusername"!

    I tested the url last night by just putting it in the browser to see if it was the script itself to start with. Maybe that's the way I should go then.

    I do have the backup set to email me, but no matter what I put in the "automation" service tonight it still says it's not running til tomorrow. So... I'll wait and see if the new line - with the right username - works tomorrow night. If not maybe the URL thing will work.

    Just no sense in having a service to automatically do things and still have to remember to login and click a link to make it run manually. lol I like the program though, have it styled now and have edited the template to remove some of the billing features that make absolutely no sense.
    (the script can't store CVV but won't authorize without a CVV - even when you have that option off.)

    So, a CRON is basically telling the server to run the services.php file script based on "rebiller", "backup"... at a certain time on a whatever day right? Does the services.php file then just update the results in CE admin based on the CRON results that's set-up in cpanel? How does services.php know what happened in the CRON? Is there a log somewhere?
    Thank you,
    Lynne Hanson
    RL Hanson-Online

  8. #8
    Matt's Avatar
    Matt is offline GlowHost Administrator
    Join Date
    Jan 2005
    Location
    Behind your monitor
    Posts
    6,219

    Default

    Unfortunately i do not know much about ClientExec and how the functions work. But I do know that if the script can be called in a web browser, that a cron can be setup to do the same thing which is to execute the script. If GET doesnt work you can use lynx or curl too, we will have to see how it goes....

    But, you should check if that script only works if you are logged in, so try running it when you know you are logged out of CE.

    If it doesnt work in your browser when you are logged out of client exec, then you need to run from the command line like my first example. If that one doesn't work

    php /home/myusername/public_html/hosting/services.php 'rebiller'

    you can try:

    cd /home/myusername/public_html/hosting/; php services.php 'rebiller'

    or

    cd /home/myusername/public_html/hosting/; php services.php

    Just make sure to change 'myusername' to the real username.

    If you have a shell I would run these commands first and see what they do. If they work in shell, then the cron will work.
    Send your friends and site visitors to GlowHost and get $125 plus bonus!
    GlowHost Affiliate Program | Read our Blog | Follow us on X |

  9. #9
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default

    I finally got the CROn jobs to run by using:
    The client exec still automatically puts the CRON in the cpanel in the format that wasn't working but since I have the CURL commands in there it is finally auto-magically working!
    Thank you,
    Lynne Hanson
    RL Hanson-Online

Similar Threads

  1. Web Mail Cron Job
    By jamison in forum Programming Talk
    Replies: 1
    Last Post: 10-29-2008, 11:25 AM
  2. Cron.PHP for Drupal?
    By JohnMorris in forum General Support
    Replies: 3
    Last Post: 06-27-2008, 10:34 PM
  3. Cron Job for Awstats
    By charlesh in forum WHM, Resellers, VPS and Dedicated Hosting Topics
    Replies: 2
    Last Post: 06-10-2008, 11:45 PM
  4. cron job errors, probably due to some delay
    By omarfilip in forum General Support
    Replies: 2
    Last Post: 02-03-2008, 04:04 AM
  5. Can I Set up a Cron Job for Backups
    By asz in forum cPanel Topics
    Replies: 1
    Last Post: 03-03-2005, 07:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14