LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   user crontab and msmtp packages not working together ? (https://www.linuxquestions.org/questions/linux-server-73/user-crontab-and-msmtp-packages-not-working-together-720335/)

frenchn00b 04-20-2009 01:29 AM

user crontab and msmtp packages not working together ?
 
Hello,

Have you also troubles with user crontab and msmtp packages to be working together ?

1/
configure well your msmtp to send email
check it
echo "test yes" | mutt robert
it works, OK,
let's continue

2/
example, as user, edit crontab
with
Code:

crontab -e
put this
Code:

0 8    * * *  echo "test yes" | mutt robert
3/ wait and check your mail box

NOTHIGN

You too ?

--
I used :
nbsmtp and it is working :)
seems that there is BUGS somewhere

MensaWater 04-20-2009 10:10 AM

cron runs a minimal shell not the one you inherit when you type on command line.

Put in full path to echo command and to mutt command and it will likely work. e.g.

Code:

0 8    * * *  /bin/echo "test yes" | /usr/bin/mutt robert
Also note that most Bourne based shells have an "echo" built in and they do different things. For your example I imagine the /bin/echo will work fine.

Finally: There could be issues with quoting as it is being processed by cron and then by the shell whereas your command line is only going to the shell directly. I doubt that is an issue in your example though but it is something to keep in mind for more complicated command lines.


All times are GMT -5. The time now is 06:13 AM.