Re: pg_dump from crontab

From: Adam Radlowski <adamr(at)informatyka(dot)gdansk(dot)pl>
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-11 06:06:10
Message-ID: 44DC1E52.5050802@informatyka.gdansk.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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*
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Al-Amin Ali 2006-08-12 09:28:52 unsubscribe
Previous Message Tom Lane 2006-08-10 23:10:39 Re: data for 64bits on 32