Re: [CentOS] centos 6.3, cron and mail script output

2012-11-28 Thread Les Mikesell
On Mon, Nov 26, 2012 at 12:32 AM, Mihamina Rakotomandimby miham...@rktmb.org wrote: I have MAILTO=root in the file. If I make a CLI test to mail to root, all is working. Is there a special feature such as it only mail if STDERR? Because all the messages (rsync output + echo foo) is to

Re: [CentOS] centos 6.3, cron and mail script output

2012-11-26 Thread Karanbir Singh
On 11/26/2012 06:32 AM, Mihamina Rakotomandimby wrote: I have MAILTO=root in the file. If I make a CLI test to mail to root, all is working. Is there a special feature such as it only mail if STDERR? Because all the messages (rsync output + echo foo) is to STDOUT. You can send the stdout to

Re: [CentOS] centos 6.3, cron and mail script output

2012-11-26 Thread Mihamina Rakotomandimby
On 11/26/2012 09:41 AM, John R. Dennison wrote: On Mon, Nov 26, 2012 at 09:32:37AM +0300, Mihamina Rakotomandimby wrote: Is there a special feature such as it only mail if STDERR? Because all the messages (rsync output + echo foo) is to STDOUT. Nope. _ALL_ output, bother stdout and stderr,

Re: [CentOS] centos 6.3, cron and mail script output

2012-11-25 Thread Mihamina Rakotomandimby
On 11/23/2012 12:18 PM, Birta Levente wrote: check out the crontab file if you have these, If it's centos 6, maybe /etc/anacrontab I have MAILTO=root in the file. If I make a CLI test to mail to root, all is working. Is there a special feature such as it only mail if STDERR? Because all the

Re: [CentOS] centos 6.3, cron and mail script output

2012-11-25 Thread John R. Dennison
On Mon, Nov 26, 2012 at 09:32:37AM +0300, Mihamina Rakotomandimby wrote: Is there a special feature such as it only mail if STDERR? Because all the messages (rsync output + echo foo) is to STDOUT. Nope. _ALL_ output, bother stdout and stderr, will be sent via mail to the owner of the crontab

Re: [CentOS] centos 6.3, cron and mail script output

2012-11-23 Thread Banyan He
check out the crontab file if you have these, SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root === that's what you are looking for HOME=/ # run-parts 01 * * * * root run-parts /etc/cron.hourly 02 4 * * * root run-parts /etc/cron.daily 22 4 * * 0 root

Re: [CentOS] centos 6.3, cron and mail script output

2012-11-23 Thread Birta Levente
On 23/11/2012 10:28, Banyan He wrote: check out the crontab file if you have these, If it's centos 6, maybe /etc/anacrontab SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root === that's what you are looking for HOME=/ # run-parts 01 * * * * root

Re: [CentOS] centos 6.3, cron and mail script output

2012-11-23 Thread Philippe Naudin
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

Re: [CentOS] centos 6.3, cron and mail script output

2012-11-23 Thread Philippe Naudin
Le ven. 23 nov. 2012 10:42:19 CET, Philippe Naudin a écrit: ... rsync ...options... 21 LOGFILE echo -e finished pushing to the backup \n$LOGFILE Nonsense, sorry. If the output is short, you can do : LOGS=$(rsync ... 21) echo -e finished pushing to the backup \n$LOGS I you expect longer

[CentOS] centos 6.3, cron and mail script output

2012-11-22 Thread Mihamina Rakotomandimby
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