Location of crontab file in linux

I have Suitecrm 7.7.9 loaded on Ubuntu 14.04. I use Suitecrm for the internal email capability. However, the time it takes to delete or import an email into the application is always five minutes. I suspect it has to do with the cron job in linux. I do not see any reference to setting up a linux crontab file. (There is discussion about setting up a Windows crontab file). How do I do that in Ubuntu? I noticed here is a command I can copy but as a newbie to Ubuntu I do not know where to create and run the file.

Can someone help please?

There is not one, but several cron files. In Ubuntu you can edit the system-wide crontab with

sudo nano /etc/crontab

You can edit the root user crontab with

sudo crontab -e -u root

And you can edit the web server user crontab with

sudo crontab -e -u www-data

That user name (www-data) is highly likely what you have, but not necessarily so.

But I question your basic connection between slow-email and the need to edit crontab. How did you reach that conclusion? What do you plan to do in crontab once you get there?

Hi,

I am having trouble with wait time. As you can see in the screen shot attached, After I, either delete or import into crm, the “one moment please” message appears and I cannot do anything for five minutes. I have to wait for this message to disappear before I can use the system again. I thought it might be the crontab settings being set to a five minute cycle (not so, I checked - all stars in the cron tab file). Also, in the administrator setting, under the schedule page, no processes have been run. When looking at the individual stats, the last time run comment is “never” for all processes. So I thought I should add in instruction but it it already listed in the crontab.

Also, I think I once read there is a difference if a user is setup as an individual or part of a group. That would effect email. I do not know. Have you heard anything about it? I am setup as an individual and do not know how to change that setting either.

best

Dave

I don’t think your problem has anything to do with cron. You probably just have a database that grew too large, or has some inconsistency in it. Or you could simply be having some network delay when accessing your mail server.

  1. Anyway, to clear things up please tell me the exact contents of your cron file, and which cron file it is (from the three I mentioned above).

  2. Then if you could look at the contents of your log (suitecrm.log and php_errors.log, Google it if you need instructions), you probably have some clue there of what’s going wrong. Look for FATAL or ERROR messages at the time of the delays.

  3. And please give us some more info on your system (OS, Web server, PHP, MySQL, SuiteCRM versions) and email setup.

Please answer all three requests. Thanks.

I am running a Dell 1950 server with the following software:

Ubuntu version 14.04.5 LTS trusty

Apache version 2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.21

MYSQL version 5.5.54-0ubuntu0.14.04.1

SuiteCRM verion Version 7.7.9 Sugar Version 6.5.24 (Build 509)

My email is setup using my company email system. We use an off site service to handle our emails. I am using port 587 no SSL or TLS and I am using SMTP authentication.

I checked my crontabs and they are as follows:

/etc/crontab

/etc/crontab: system-wide crontab

Unlike any other crontab you don’t have to run the “crontab”

command to install the new version when you edit this file

and files in etc/crontab.d. These files also have username fields,

that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

m h dom mon dow user command

17 * *** root cd / && run-parts – report /etc/cron.hourly6a
25 6 *** root test -x /usr/sbin/anacrom || ( cd / && run-parts --report /etc/cron.daily)
47 6 7 root test -x /usr/sbin/anacrom || ( cd / && run-parts --report /etc/cron.weekly)
52 6 1
root test -x /usr/sbin/anacrom || ( cd / && run-parts --report /etc/cron.monthly)

***** cd /var/www/html/SuiteCRM; php -f cron.php > /dev/null 2>&1

Crontab -e -u root

5# Edit this file to introduce tasks to be run by cron

Each task to be run has to be defined through a single line

indicating with different fields when the task has to be run

and what command to run for the task

To define the time you can provide concrete values for

minute (m), hour (H), day of month (dom), month (mon),

and day of week (dow) or use “*” in these fields (for “any”).

Notice that task will be started based on the cron’s system

daemon’s notion of time and timezones.

Output of the crontab jobs (including errors) is sent through

email to the user the crontac file belongs to (unless redirected).

For example, you can run backup of all user accounts

at 5 a.m. every week with:

0 5 ** 1 tar -zcf /var/backups/home.tgz /home/

For more information see the manual page for crontab (5) and cron(8)

n h dom mon dow command

Crontab -e -u www-data

usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
usage: sudo [AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user] [VAR=value] [-il-s] []
usage: sudo -e [-AknS] [-r role] [-t type] [-g group] [-h host] [-p prompt] [-u user] file …

I checked my Suitecrm log file. I was receiving one FATAL error due to the fact that I did not set the date and time. I added the date and time with location to the php.ini file and the error reporting stopped.

Emails: I am still having problems with emails. They send and receive immediately however I still have to wait five minutes for the email to be imported into SuiteCRM or be deleted.

What can I check next?

(First, just a tip about these forums: you can use “code” tags to enclose bit of programs or output from the shell, it makes it easier to read and preserves whitespace.)

I see a problem in your system-wide crontab. That particular crontab uses an extra column for the user name.

So, instead of using

* * * * * cd /var/www/html/SuiteCRM; php -f cron.php > /dev/null 2>&1

you should be using

* * * * * www-data cd /var/www/html/SuiteCRM; php -f cron.php > /dev/null 2>&1

if, indeed, the username your webserver is using, is called www-data.

If your cron jobs were never running, then your database has never been pruned. So it might have grown gigantic, and that would explain the long delays.

You might want to get into phpMyAdmin and have a look at your suitecrm database, and check the size of tables to see the biggest ones you have.