[CentOS] centos 6.3, cron and mail script output

Fri Nov 23 09:42:19 UTC 2012
Philippe Naudin <philippe.naudin at supagro.inra.fr>

Le ven. 23 nov. 2012 10:52:50 CET, Mihamina Rakotomandimby a écrit:

> Hi all
> I have a '/etc/cron.daily/push-to-backup' script which the content is:
>    #!/bin/bash
>    /usr/bin/rsync [... long options line ...]
>    echo "finished pushing to the backup"
> Launched manually, it's OK.
> Waiting for cron to execute it,
> In the "/var/log/cron", I see the starting time and the finish time, and 
> I see it take about 10 minutes to make the job. That's very fine, it's 
> the expected executioon time
> ...

Compare the execution time to the timeout option of your smtp server.

I don't know about exim, but on my postfix I added :
smtpd_timeout = 30m

Another possibility is to "spool" the mail, something like :
rsync ...options... 2>&1 > LOGFILE
echo -e "finished pushing to the backup \n$LOGFILE"


Philippe Naudin
UMR MISTEA : Mathématiques, Informatique et STatistique pour 
l'Environnement et l'Agronomie
INRA, bâtiment 29   -   2 place Viala   -   34060 Montpellier cedex 2
tél:, fax:, mél: naudin at supagro.inra.fr