Welcome Guest, Not a member yet? Register   Sign In
Can anyone answer my sendmail cron conundrum?
#1

[eluser]Unknown[/eluser]

Hi guys

I am hoping one of you can help me with my sendmail cron issue, as I cannot seem to get to the bottom of it.

I have a Codeigniter PHP file that works perfectly when run from the command line like so: "php /var/www/index.php mailer sendInstancesNear248" This script uses the postfix smarthost email server on the local box to send an email.

However, I have added this to my crontab using "sudo crontab -e" (So this has added it to the root user crontab if I recall).

This fails however and sends the following message to the root user "p/usr/share/sendmail/sendmail: 1248: /usr/sbin/sendmail-msp: not found".

The cron entry is as follows.
"20 21 * * 7 php /var/www/index.php mailer sendInstancesNear248"

Any ideas guys??
#2

[eluser]smilie[/eluser]
When logged in through SSH, from command line do:

which php

It should give you full path to you PHP executable, then in crontab do:

20 21 * * 7 root /path/to/php /var/www/index.php mailer sendInstancesNear248

You could also add something like:

> /path/to/log.file

at the end of the crontab line, just to be able to check output (if you have any).

Cheers,
Smilie




Theme © iAndrew 2016 - Forum software by © MyBB