pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adam Radlowski <adamr@informatyka.gdansk.pl>
To: Nirav Parikh <niravp@alliancerecruitment.com.au>
Cc: pgsql-admin@postgresql.org
Subject: Re: pg_dump from crontab
Date: Fri, 11 Aug 2006 08:06:10 +0200
Message-ID: <44DC1E52.5050802@informatyka.gdansk.pl> (raw)
In-Reply-To: <221385EC3F18A44DB0925467A1D2395F568D6D@exsrv3.workskillsprofessionals.com.au>
References: <221385EC3F18A44DB0925467A1D2395F568D6D@exsrv3.workskillsprofessionals.com.au>

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*
>




view thread (5+ messages)

Message-ID: <44DC1E52.5050802@informatyka.gdansk.pl>
Permalink:  ../44DC1E52.5050802@informatyka.gdansk.pl/
Also on:    postgresql.org/message-id/44DC1E52.5050802@informatyka.gdansk.pl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: adamr@informatyka.gdansk.pl, niravp@alliancerecruitment.com.au
  Subject: Re: pg_dump from crontab
  In-Reply-To: <44DC1E52.5050802@informatyka.gdansk.pl>
  References: <221385EC3F18A44DB0925467A1D2395F568D6D@exsrv3.workskillsprofessionals.com.au> <44DC1E52.5050802@informatyka.gdansk.pl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox