Re: pg_dump from crontab

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Nirav Parikh <niravp(at)alliancerecruitment(dot)com(dot)au>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_dump from crontab
Date: 2006-08-10 19:03:40
Message-ID: 1155236620.20252.167.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, 2006-08-04 at 02:20, Nirav Parikh wrote:
> Hi,
>
> I am having problem backing up database from crontab, I got following
> lines in crontab file
>
>
> 0 20 * * 5 /usr/pgsql/bin/pg_dump -F c database >
> /usr/backup/friDATE4.pgdump
> 0 20 * * 4 pg_dump -F c database > /usr/backup/thurDATE06-3.pgdump
>
> none of them works, I have given full permission to everyone in
> /usr/backup directory
>
> it creates the dump file but with 0 size - empty!
>
> I have other commands in crontab which executes normally, also pg_dump
> command works through command line.
>
> does anyone what else I can check?

Often, I need to add the path to the pg_dump files, and I also set my
shell and home directory in my crontab. Don't know if it'll help, but
it won't hurt.

PATH=/usr/local/pgsql/bin:/bin:/usr/bin
SHELL=/bin/bash
HOME=/home/smarlowe

Then I set my passwords in the ~/.pgpass file so that the various psql
scripts can log in.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Steve Crawford 2006-08-10 19:04:25 Re: pg_dump from crontab
Previous Message Ivo Rossacher 2006-08-10 19:00:09 Re: pg_dump from crontab