[CentOS] centos 6.3, cron and mail script output

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


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"

hth,

-- 
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: 04.99.61.26.34, fax: 04.99.61.29.03, mél: naudin at supagro.inra.fr


More information about the CentOS mailing list