We've just moved servers, from FreeBSD to CentOS. We have around 30 cron jobs which run throughout the day.

Since moving, it seems that some cron jobs are starting but not completing. We can see they kicked off but it's like they have timed out.

No errors in the phperror.log. Cron log shows the tasks starting. Also, we don't get emailed the output of the cronjobs - even though we have MAILTO=ben@domain.com at the top

These are PHP files, run using /usr/bin/php /path/to/file.php

I presume this is down to a mis config on the new server, but what could it be?

  • 4
    Also, it could be missing some required PHP package. I think it is a good idea to modify your script to include debug messages which should be saved in a log file. Also, did you try to run these scripts manually from the shell? – Khaled Jan 21 '12 at 8:58
  • I could be anything. What have you checked so far? Are the cron-jobs still running as process? If not this is no cron issue. Have sent test-mails with mailx? Is your mailq empty? If yes - this is no mail issue. So it is propably PHP that is misbaving - debug it. – Nils Jan 21 '12 at 21:38
  • They work fine from shell. I haven't tried mailx - will give that a go and see if it sends correctly, that will help with debugging. – Ben Jan 22 '12 at 20:34

Fixed this. IT seems that Postfix wasn't installed correctly. Due to this the Crons were stalling for some reason (perhaps when they tried to access mail) and also logs not being generated.

After reinstalling Postfix, everything works

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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