Re: pg_dump from crontab - Mailing list pgsql-admin

From Adam Radlowski
Subject Re: pg_dump from crontab
Date
Msg-id 44DC1E52.5050802@informatyka.gdansk.pl
Whole thread Raw
In response to pg_dump from crontab  ("Nirav Parikh" <niravp@alliancerecruitment.com.au>)
List pgsql-admin
Try (do not use ">" output stream redirection, but "-f" switch):
0 20 * * 5 /usr/pgsql/bin/pg_dump -F c database -f
/usr/backup/friDATE4.pgdump
0 20 * * 4 pg_dump -F c database -f /usr/backup/thurDATE06-3.pgdump
Or instead (if it will not work):
1. Put those commands into root crontab file (/var/spool/cron/root)
2. Instead raw putting the commands into crontab file, put them into
scripts and run for them the shell - for example:
0 20 * * 5 /bin/sh /home/scripts/fri_date4.sh
0 20 * * 4 /bin/sh /home/scripts//thur_date06-3.sh

Into /home/scripts/fri_date4.sh You put line:
/usr/pgsql/bin/pg_dump -F c database -f /usr/backup/friDATE4.pgdump
Into /home/scripts//thur_date06-3.sh You put line:
pg_dump -F c database -f /usr/backup/thurDATE06-3.pgdump

Greetings
Adam

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?
>
>
>
>
> Regards*, *
>
> * *
>
> * *
>
> *Nirav*
>


pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: data for 64bits on 32
Next
From: Al-Amin Ali
Date:
Subject: unsubscribe