Re: error messages not getting logged when running script from cron

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: anj patnaik <patna73(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: error messages not getting logged when running script from cron
Date: 2015-11-23 20:21:12
Message-ID: 12013.1448310072@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

anj patnaik <patna73(at)gmail(dot)com> writes:
> My cron tab entry:

> 0 20 * * * db_backup.sh 1> /dev/null 2>&1 | mail -s "backup cron"
> myemail(at)comp(dot)com

> I am re-directing stderr to stdout and then sending that to email.

Uh, read it again: you're redirecting stdout to /dev/null and then
redirecting stderr to go where stdout goes. So all output is
going to the bit bucket, not the pipe.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Melvin Davidson 2015-11-23 20:29:35 Re: error messages not getting logged when running script from cron
Previous Message Kevin Grittner 2015-11-23 20:20:33 Re: error messages not getting logged when running script from cron