Re: pg dump.. issue with when using crontab

From: steeles(at)gmail(dot)com
To: "Moe" <mohamed5432154321(at)gmail(dot)com>, pgsql-general-owner(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: pg dump.. issue with when using crontab
Date: 2010-01-26 22:28:56
Message-ID: 145398635-1264544939-cardhu_decombobulator_blackberry.rim.net-2061734401-@bda103.bisx.prod.on.blackberry
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am new to posgres.
By running Pg-dump like this, do we need to type in pwd for login manually?

Thanks
Sent from my BlackBerry device on the Rogers Wireless Network

-----Original Message-----
From: Moe <mohamed5432154321(at)gmail(dot)com>
Date: Tue, 26 Jan 2010 19:25:50
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: [GENERAL] pg dump.. issue with when using crontab

Thank you both, that did the trick.

Sincerely / Moe

On Tue, Jan 26, 2010 at 7:14 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Moe <mohamed5432154321(at)gmail(dot)com> writes:
> > I have a simple script file db :
> > #!/bin/bash
> > pg_dump -U postgres prodDB > /var/a/db/$(date
> "+%Y-%m-%d_%H:%M")-prodDB.dump
>
> > Which works fine when executed manually ( ./db ).. I get a dump file
> which
> > is around 1.9 MB
>
> > I run this script from the crontab schedueler (crontab -e) :
>
> > # m h dom mon dow command
> > 33 04 * * * /var/a/scripts/db
>
> > Which appears to executing the script file, but what I get is zero sized
> > dump files.
>
> cron jobs typically run with a very minimal PATH. I'll bet pg_dump
> isn't in it. Try putting the full path to pg_dump in the script.
>
> Also consider sending its stderr someplace more useful than /dev/null,
> so that you're not flying blind while debugging problems ...
>
> regards, tom lane
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2010-01-26 22:36:53 Re: pg dump.. issue with when using crontab
Previous Message Greg Smith 2010-01-26 22:22:17 Re: general questions postgresql performance config