Cron Job

I have been inform by the server provider that my shared server do not allow SSH access to run the command on the cron job interface and it is not going to work, meaning that cd /home/xxx/public_html/xxx.com/crm; php -f cron.php > /dev/null 2>&1 is not woraking.

Can someone let me know how should I do it?

Hi

on shared hostings there is often an area in your CPanel where you can enter cron commands.

Hi, thank you for your reply but let me tell you the exact problem that I may have:

  1. I hosted SuiteCRM at shared server which do not allow SSH access and root and I have been informed by the server guy as follow but it is not working also.

Pleas be informed that cd command line work on on the SSH command line. And such cron jobs that require SSH access we don’t allow on our shared server.

Also if you run the command on the cron job interface it will not work.

As for now try to run your corn job via below format:

/usr/bin/php -q /home/ultrav/public_html/yourfilename.php

  1. I try out the service from easycron but never success on version 7.9.4 but it works for version 7.8.5.

This really bother me too much as I have o idea what I can do about it as no notification is working.

Thanks a lot.

I’m having some trouble understanding parts of your english… do you, or don’t you have SSH access? Which parts of the text are yours, and which are from your provider?

But if I understood correctly, this is my advice:

1- You don’t need SSH access or root access to set up cron jobs if your hosting provides some other way to set them up: usually it’s a menu option on your CPanel.

  1. You just have to get the command right, and it might be difficult. From what I see in your text I would try:
cd /home/ultrav/public_html; /usr/bin/php -f /home/ultrav/public_html/cron.php > /dev/null 2>&1 

Check those paths to make sure they are correct. By using a full path for everything (starting directory, php exectuble, cron.php) you should be able to get it running.

If your base path is not /home/ultrav/public_html/ then change both the above paths to /home/ultrav/public_html/ultrav.com/crm or something.

I am sorry about my English.

I don’t have the access neither to SSH nor root access but I can access to the Cron Jobs through Cpanel ; however according to the server provider that I cannot run the command from the Cron Jobs interface by using cd /home/ultrav/public_html/xxx.com/suitecrm; php -f cron.php > /dev/null 2>&1 because it will not work on their share server, the /usr/bin/php -q /home/ultrav/public_html/xxx.com/suitecrm/cron.php is what they suggested for the cron job but it it is not working either.

I am trying cd /home/ultrav/public_html/xxx.com; /usr/bin/php -f /home/ultrav/public_html/xxx.com/cron.php > /dev/null 2>&1 to see if it will work.

Thanks a lot

You can leave out the “cd” if they don’t allow it.

But what exactly is the full path to the cron.php file?

Try just

/usr/bin/php -f /home/ultrav/public_html/cron.php > /dev/null 2>&1

But fix that path to the cron.php file if it isn’t correct. You should be able to check by simply looking for the file in CPanel’s File Manager.

And then, why do you say “it’s not working”, how are you checking? It could be working in the sense that the cron jobs are launching, but it’s failing some other thing after that.

If you read this there are some tips there to help you in this process.

Hi, the server provide confirmed that the cron is running but the email notifications are not working because I can only receive the very first email to notify about the meeting but not the rest when even I have set all the available reminders just for testing purpose. I tried also using the service from easycron, the crons are failed while working fine on version 7.8.5.

I also tried to use SuiteCRM version 7.8.5 and found that the desktop alert and email notification are working fine.

I think there is a problem with the installation of SuiteCRM from softaculous, i installed the software from Filezilla and the cron is working fine. I just don’t understand why.

Ah, Softaculous. I know what the problem with that is. Softaculous installations run with a different user than the one your app is going to use. So the SuiteCRM installer will register that user in config.php (array cron_allowed_users) but then that won’t work when you finally run the jobs.

You can check all this by having a look at your suitecrm.log, there should be a message there explaining the problem. It’s always a good idea to start with the logs when you need to troubleshoot something.

Let me know if you can fix it. The correct username you need to use in cron_allowed_users should be in the log message.

1 Like

Hi,

I can see these message “cron.php: running as ultrav is not allowed in allowed_cron_users in config.php. Exiting.” in the log file but I have no idea where can I find the user name, I also cannt find the user name in softacoluos installation details.

Iinstlled 3 copies of suitecrm, but nothing mentioneed about the user name as well.

I said it in my previous post, and I linked you to a document explaining; you just have to go into config.php and change the entry inside the cron_allowed_users array to be “ultrav” which is given to you in the log message, as I said.

Please don’t get addicted to quickly posting in the forum whenever a doubt arises: you need to read carefully, use your head, Google for answers… only that way you can become independent in your work… and saves us the extra work.

Good luck, I’m sure you can work it out! : - )

Thank you and I have gotten t resolved, the name used by Softaculous was “Apache”, after changed it the ultrav, it is working now.

Now, I have another issue, I changed the URL name to other name by changing the site folder name, the “undefined” is start showing up just like due to the permission issue, is there anything I have missed or done wrong? How can I resolve this “undefined” issue?

By the way, I don’t just post the questions here and just hope an answer/solution, I did some research and I only ask for help if I can find any, furthermore I don’t have good knowledge about script or coding but I always learn hard.

Thanks for your help so far, really appreciate that. :slight_smile:

There are a couple of settings in config.php that you might need to adjust after changing the site URL:


  'host_name' => 'site.no-ip.org',
  'site_url' => 'http://site.no-ip.org',

I’m using SiteGround shared hosting and then just assisted me in setting up the Crone job to run the schedule but thought it may be useful for others on the forum who may have the same hosting company have the information on how to do this

The cron job:

/usr/local/php56/bin/php-cli -f /home/user_name/public_html/crm/cron.php > /dev/null 2>&1

Where,

/usr/local/php56/bin/php-cli - is the path to the php-cli binary

and

/home/user_name/public_html/crm/cron.php - is the full path to the cron.php file.

If you go to cPanel Advance settings which of mine is at the bottom you will then see CRON Jobs.

Hope this helps anyone else using SiteGround web hosting I’ve always found the support to be excellent and extremely quick.

Does that look very different from what SuiteCRM recommends in the Admin / Scheduler screen, at the bottom? Please tell me what you find there, I’d like to check this.

Yes it is very different to what are set out in suiteCRM but it is correct and it is working.

I tried a number of times myself to try and get the CRON job working but without success so eventually posted a support ticket with the information at the bottom of sweetCRM. And they implemented the CRON job for me on my account and it appears to be working successfully.

There are some CRON jobs which are showing as having not run so I don’t quite understand is most of them are now working successfully

But post here what SuiteCRM is telling you to use.

I wrote that code and I want to improve it :slight_smile:

1 Like