The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Unable to insert cron job in cpanel

Discussion in 'General Discussion' started by Brightonian, Mar 17, 2011.

  1. Brightonian

    Brightonian Member

    Joined:
    Mar 17, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Hi all

    I've been trying to insert a cron job in the cron job section of cpanel but it just won't accept the cron.
    It keeps on producing an Ajax error and says to refresh and try again which I have done countless times but with no good results.
    Does anyone know what is causing this as I am lost for ideas on this.
    I'm using firefox and tried it with chrome and it does the same thing so don't know what else to check.

    Any help in getting this sorted would be appreciated.

    I've attached the error it produces and I've tried several cron commands but don't know which one will work correctly as one of them kept on filling my home directory with many 0byte "index.html*" files.
    These are the commands I tried to use:

    1. wget -q 'http://www.cancasa.com/system/miscellaneous/task_scheduler/' -o - > /dev/null

    2. wget -q 'http://www.cancasa.com/system/miscellaneous/task_scheduler/' -o > /dev/null

    3. wget 'http://www.cancasa.com/system/miscellaneous/task_scheduler/' -o > /dev/null

    4. wget -q 'http://www.cancasa.com/system/miscellaneous/task_scheduler/' -o - > /dev/null; rm -f index.html

    Thanks :)
     

    Attached Files:

    • cron.jpg
      cron.jpg
      File size:
      149.3 KB
      Views:
      252
    #1 Brightonian, Mar 17, 2011
    Last edited: Mar 17, 2011
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,452
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Try adding this using another browser. There's a thread about some AJAX issues with Safari and I'm guessing this might be the issue for you.
    Also I'm not so sure that command is the best way to go. What is it you're trying to do there?
     
  3. Brightonian

    Brightonian Member

    Joined:
    Mar 17, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Thanks Infopro

    I've tried it with Firefox, Chrome and IE but no joy.
    The site www dot cancasa dot com runs a script for property listings by owners and needs to run a task scheduler to expire listed properties.
    I got the original cron command from the script writers but have had several problems with it ranging from not working correctly to dumping loads of index.html files in the home directory.

    I also contacted the host and it seems they were able to insert this cron command: wget 'http://www.cancasa.com/system/miscellaneous/task_scheduler/' -o > /dev/null

    but can't figure out why I can't do the same, besides I received the following message when it was run:
    wget: option requires an argument -- o

    All I'm looking for is to set up a cron to run the above task but now it's becoming a major operation lol.

    Thanks :)
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,452
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I'm not sure but it sounds to me like you've got this wrong somehow. WGET command is probably not the correct command to be using. The task scheduler file should probably be on your server, not pulled from another.

    I'm sorry I can't help more than that, this command looks wrong to me. Hopefully someone else here can help, but I'd go back to the script developers first.
     
  5. Brightonian

    Brightonian Member

    Joined:
    Mar 17, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Thanks Infopro,

    I was just following the instructions from the /http://demo.worksforweb.com/iRealty/doc/UserManual/
     
  6. Brightonian

    Brightonian Member

    Joined:
    Mar 17, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Why has my post been removed :confused::confused:
    Very strange.
     
  7. Brightonian

    Brightonian Member

    Joined:
    Mar 17, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Can someone have the decency to explain why my previous post was removed :mad:
    It is important to the resolution of this problem as it shows details of the cron :confused:
     
  8. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,452
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    In that it shows site.com, not their site, a site. I think. Meaning this script is to run from your own server. I'd have to read more of the docs and installation to help there but no time for that today.

    I apologize but this might be better taken up with your host, or support for the script. You should go over your installation again and check the docs more to be sure you've got this all setup correctly.

    Setup and configuration of a script (not cPanel) is a bit outside of the scope of these forums.
     
  9. Brightonian

    Brightonian Member

    Joined:
    Mar 17, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Exactly Infopro.
    That's why the cron job is wget -q 'http://www.cancasa.com/system/miscellaneous/task_scheduler/' -o - > /dev/null

    It has my url inserted correctly and just needs to work correctly but CPanel is not accepting it and keeps on returning an AJAX error as mentioned in very first post.

    All the relevant files are on the server so no reason why it shouldn't work.

    I've attached a snapshot of the user manual instructions for the cron as the link provided previously is not opening the correct page.

    Hope you understand my situation now.

    Thanks
     

    Attached Files:

    #9 Brightonian, Mar 17, 2011
    Last edited: Mar 17, 2011
  10. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,452
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Well, I quoted the cron doc just above, image shouldn't be needed. ;)

    OK, lets try this then. Assuming the account you're setting this up on can use WGET, try editing the cron to something along these lines:

    This assumes there is a php file named index.php in that directory. If not you've have to sort that out.
     
  11. Brightonian

    Brightonian Member

    Joined:
    Mar 17, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Hi Infopro, sorry no offence intended by posting the image, just thought it was easier for other potential helpers.

    Just some background info here, I recently deleted the cron because it kept on dumping loads of index.html files in the home directory so I would presume that meant the command was working.
    If I could now only get it to accept a new cron without giving Ajax errors, I might be able to figure it out but it still isn't allowing me to add a new cron.

    I'm going to give your command above a try and see if it is accepted in my cpanel.

    Thanks

    UPDATE

    I inserted the command you gave me with my username inserted and the system accepted it.
    Don't know how to check if it's working but I guess I'll have to wait until it reaches the schedules time and hope to receive an email showing no errors.

    Index.php file DOES exist in that folder so I think you may have cracked it. Just the waiting now.

    Great stuff sir.

    Thanks
     
    #11 Brightonian, Mar 17, 2011
    Last edited: Mar 17, 2011
  12. Brightonian

    Brightonian Member

    Joined:
    Mar 17, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Got the following message from the cron when it was run on schedule:

    "No input file specified"

    Really don't know what else to try so if anyone has any ideas, I'd be grateful.

    Thanks.
     
  13. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Change the command to the following:

    Code:
    php -q -f /home/yourusername/public_html/system/miscellaneous/task_scheduler/index.php
    I see no reason at all that you would have two folder paths for this cron. What is the purpose of the cron again? Do you have documentation on using the cron in a how-to for whatever script is being used for us to review?
     
  14. Brightonian

    Brightonian Member

    Joined:
    Mar 17, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Hi Tristan

    Not very good at this m trying my best.
    The cron runs with a script on my site for property listings by owners which was in set up when purchased and I think it works with notifications and the expiration of listed properties.
    The only documentation I have is as shown in attached image.
    I saw an index.php file for the script in the cpanel but not sure what it's supposed to contain if the cron is to work correctly.

    I'll insert the command you gave above and see if it works but the original command the script writers gave me is as follows:

    wget -q 'http://www.cancasa.com/system/miscellaneous/task_scheduler/' -o - >
    /dev/null

    I even tried to insert this command again a second ago and it still returned an Ajax error but strangely it was inserted when script was installed with no error but the reason I removed it was to stop index.html files being dumped in the home directory.
    Now that I want to reinsert it, seems like it's no longer accepting it but I will try your command now and pray tat it resolves it.

    Many thanks.
     

    Attached Files:

  15. Brightonian

    Brightonian Member

    Joined:
    Mar 17, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    After doing some thorough checking of the directories, I found that the path the script writers give in the manual is incorrect.
    The actual path of the file in question is:

    /public_html/system/user-scripts/miscellaneous/task_scheduler.php

    It seems they missed out the "user-scripts" part of the path. :(

    Apologies about this but as mentioned earlier, I'm not a programmer, just trying my best. :eek:

    I've attached the details of the tasks from the php file in text form to give an idea of what the cron is used for.

    Does this mean I just add the user-scripts part to the above code or do I need something different?

    Apologies for all these questions but I'm just a tad confused. :)

    Thanks
     

    Attached Files:

  16. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Just add the user-scripts part to the path provided previously.
     
Loading...

Share This Page