Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am pretty inexperienced in Linux, so be descriptive on your answer.

My environment: Local Linux server 12.04 hosting Sugar CRM 6.5.2.

There is area in sugar CRM called scheduler. I can configured some predefined jobs here. in my case i am trying to run email reminders (ever min/hour/day/month). For this scheduler to be effective, i read some where i need to setup CRON job. So I did some research & finally put following lines in CRONTAB for the root user, as per instructions given in sugarCRM.

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

Well I am creating contracts in my sugarCRM (AOS module) & I want email reminders to be sent for these contracts to the concern person. Now my sugarCRM email is configured correctly & I can send test emails using it. But the CRON + scheduler not giving any result. I can't receive any emails.

Then I tried to read /var/log/syslog & it is showing entry for following line each minute.

Oct 27 15:03:01 unicomm CRON[28182]: (root) CMD (cd /var/www/crm; php -f cron.php > /dev/null 2>&1)

I've few questions:

  1. what does the CRON job line i've added in crontab mean? cd /var/www/crm; php -f cron.php > /dev/null 2>&1 is not making any sense to me.
  2. How am i suppose to get this thing work? I've searched a lot (including SugarCRM forum), but no luck.
share|improve this question
    
If you run the cron job right from the command line, does it work? –  jmertic Oct 31 '12 at 18:07

1 Answer 1

The line in the crontab just executes the command cd /var/www/crm; php -f cron.php > /dev/null 2>&1. What this command actually does is that, it changes the current working directory to /var/www/crm and tries to execute the cron.php file there using the php interpreter. The output and errors are redirected to /dev/null, ie, they're discarded.

If you want the emails to be sent, you have to check if the cron.php is actually having code to send emails and whether that code is getting executed.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.