Skip to main content

Cannot get cronjob to run in cpanel

Comments

27 comments

  • andrew.n
    Why don't you run this with direct paths instead of wget? I think that would be a better solution here.
    0
  • Sunlander
    Hi, thanks for responding. Could you provide an example what a direct path looks like? I am a complete novice with cronjobs and have tried all sorts of solutions I have found online but none work so far. I also wanted to know if that jailbreak message was anything to be concerned about. Kind regards
    0
  • cPRex Jurassic Moderator
    You can read more about jailshell here:
    0
  • Sunlander
    Hi CPrex, thanks for your reply I just tried this: /usr/bin/php /home/mysite/public_html/index.php?option=com_acym&ctrl=cron > /dev/null 2>&1 Is this the correct way to write it? as those other examples go straight to an actual php file where the above is a url link? Do I need this jailshell? Could that be part of the problem why it isn't firing?
    0
  • cPRex Jurassic Moderator
    I still think there's some confusion. Let's not worry about jailshell for now. Do you need the PHP scripts to run like they are in a browser? Calling the path with /home isn't a link like what a browser would use. Is this a certain piece of software you purchased? If so, that company may be able to tell you how to run the cron jobs.
    0
  • Sunlander
    I have been in contact with the component developer acyba.com and this is what they said: "If you want to use your own server cron job instead, you have to properly configure a cron job. Just placing your cron job URL is not good enough because you also need to configure a command which will try to open cron job URL and trigger it that way For example, something like this wget --no-check-certificate -O /dev/null "href=" /dev/null 2>&1 " But i couldn't get that to fire.
    0
  • cPRex Jurassic Moderator
    I would guess that's just a formatting issue from the way they sent you the code. Can you try this manually on the command line to see if it worsk for you there? wget --no-check-certificate https://www.mysite.com/index.php?option=com_acym&ctrl=cron > /dev/null 2>&1
    0
  • Sunlander
    Hi, this is what is returned when I run that in command line: [root@**** ~]# wget --no-check-certificate Resolving www.mysite.com (www.mysite.com)... ***.***.**.** Connecting to www.mysite.com (www.mysite.com)|**.***.**.**|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: "index.php?option=com_acym" [ <=> ] 18,788 --.-K/s in 0s 2022-08-31 18:12:38 (177 MB/s) - "index.php?option=com_acym" saved [18788]
    0
  • ffeingol
    Have you looked in the file " index.php?option=com_acym " (yea, it's a fully name) and see if there is any output/errors?
    0
  • cPRex Jurassic Moderator
    I guess we don't have enough details to know for sure what the intended behavior is. If it's supposed to save that file, then the test we performed is working well and I would also expect that to work in a cron job.
    0
  • Sunlander
    I am still trying to figure it out sadly. I found that file (i didn't know where it was saving). Anyway, it is a 500 error apparently, but I dont know what is triggering it or ho
    0
  • Sunlander
    I am still trying to figure it out sadly. I found that file (i didn't know where it was saving). Anyway, it is a 500 error apparently, but I dont know what is triggering it or how to identify. Could it be a permission issue? If yes, how would i be able to check and correct this? I tried to post the output of that files on here but it throws an error and wouldn't save.
    0
  • cPRex Jurassic Moderator
    It might be time to poke your hosting provider, as they'd have the necessary credentials to check those errors as the root user and see if it gives more helpful details.
    0
  • Sunlander
    Thats my problem I am on a dedicated server on my own as my host dont manage dedicated servers. I have root access I just dont know the commands to write to investigate
    0
  • cPRex Jurassic Moderator
    Thanks for the additional details. If you're seeing a 500 error, it's best to check the Apache logs while that error is happening with this command: tail -f /etc/apache2/logs/error_log
    That will show you the logs in real-time while they are happening, so if you can reproduce the issue and make it happen, you'll see what is logged on the server.
    0
  • Sunlander
    Hi Cprex, thank you! This is what the outcome is of that command (I do not have wordpress so not sure what wp-login.php is) also it wont let me post all the output here so just posting the first 2 lines which are basically repeated: [Thu Sep 01 20:12:07.951424 2022] [:error] [pid 20394:tid 47308845602560] [client 171.244.17.110:34460] File does not exist: /var/www/html/wp-login.php [Thu Sep 01 20:26:23.737416 2022] [proxy_fcgi:error] [pid 31549:tid 47307544590080] [client 179.70.100.34:39474] AH01071: Got error 'Primary script unknown'
    0
  • cPRex Jurassic Moderator
    Thanks for that. The first line wouldn't be related, but the second one could be, although it doesn't tell us much. Since you have root access to the server, could you create a support ticket with our team so we can check this out directly on the system?
    0
  • Sunlander
    Hi Cprex, how do I do that?
    0
  • cPRex Jurassic Moderator
    Inside WHM you'll have the "Create a Support Ticket" option that will get the process going for you.
    0
  • Sunlander
    Ah, I found it. I have hoepfully submitted the support correctly? I have added a link to this thread
    0
  • Sunlander
    Apologies, I did it by clicking on the link in your reply, shall I do it via WHM?
    0
  • Sunlander
    I clicked on the link in your reply is that the same thing? If not I will go to WHM support area.
    0
  • cPRex Jurassic Moderator
    It all gets you to the same place :D Can you post the ticket number here so I can follow along?
    0
  • Sunlander
    Hi, just to let you/others know. Cpanel support staff helped identify what the problem was and pointed me where to go to work on the solution. Basically it is a problem with the HelixUlimate Framework system plugin which is part of the template creation component provided by joomshaper.com I have contacted them regarding a fix. Hope this helps others in their troubleshooting. Thanks so much cpanel team for being so helpful and quick to help trouble shoot. If I discover anything more regaeding this that may help I will post back. Once again thanks. On another note there seems to be an issue on these forums when replying to threads, it keeps throwing a whoops error cookies are required - even though they have been accepted and so have to trim down the response.
    0
  • cPRex Jurassic Moderator
    I'm glad to hear we were able to help!
    0
  • Sunlander
    Hi, as promised, I am back with a progress update. Unfortunately it still isn't resolved. It turned out not to be the template plugin as when default Joomla template enabled its still same issue. It seems to be that the server is rejecting the cron jobs and throws 500 errors. Someone suggested it may be a user permissions error but I don't know how to check or correct this (what the command lines are for Terminal). Someone else suggested it may be a timeout issue causing it. My question is, what would be the commands to check/rule out the above to potential causes? What else might cause the cron jobs to be rejected? Finally, what does the jailbreak error I initially mentioned mean? Could that be the issue? Hope someone can help as its nearly 3 weeks on and still not able to get the crons to run automatically.
    0
  • cPRex Jurassic Moderator
    Could you reply to the ticket you have open with us so we can take a deeper look there?
    0

Please sign in to leave a comment.