From: | Melvin Davidson <melvin6925(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | anj patnaik <patna73(at)gmail(dot)com>, 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:29:35 |
Message-ID: | CANu8Fiz4sKrT2OuCK3KFapPzD2xtxpC8M0EuFFtguUwf4Uddhw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
You could also try tweaking the following attached backup script.
Caution, I wrote this quickly from a skeleton script and has not been
tested.
On Mon, Nov 23, 2015 at 3:21 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> 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
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.
Attachment | Content-Type | Size |
---|---|---|
make_backup.sh | application/x-sh | 1.2 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | John R Pierce | 2015-11-23 20:33:08 | Re: error messages not getting logged when running script from cron |
Previous Message | Tom Lane | 2015-11-23 20:21:12 | Re: error messages not getting logged when running script from cron |