X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 109839FB334 for ; Fri, 11 Aug 2006 03:15:03 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 27961-06 for ; Fri, 11 Aug 2006 03:14:47 -0300 (ADT) X-Greylist: delayed 00:06:39.603258 by SQLgrey- Received: from ns1.peker.com.pl (181-ego-2.acn.waw.pl [62.121.85.181]) by postgresql.org (Postfix) with SMTP id 0D3259FB34D for ; Fri, 11 Aug 2006 03:14:45 -0300 (ADT) Received: (qmail 32747 invoked by uid 540); 11 Aug 2006 05:53:06 -0000 Received: from 153.19.179.26 by ns1.peker.com.pl (envelope-from , uid 401) with qmail-scanner-1.25st (clamdscan: 0.82/760. spamassassin: 3.0.2. perlscan: 1.25st. Clear:RC:1(153.19.179.26):. Processed in 0.075359 secs); 11 Aug 2006 05:53:06 -0000 Received: from rzgw.artnet.pl (HELO ?10.4.128.107?) (informatyka-adamr@153.19.179.26) by ns1.peker.com.pl with SMTP; 11 Aug 2006 05:53:05 -0000 Message-ID: <44DC1E52.5050802@informatyka.gdansk.pl> Date: Fri, 11 Aug 2006 08:06:10 +0200 From: Adam Radlowski User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716) X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: Nirav Parikh CC: pgsql-admin@postgresql.org Subject: Re: pg_dump from crontab References: <221385EC3F18A44DB0925467A1D2395F568D6D@exsrv3.workskillsprofessionals.com.au> In-Reply-To: <221385EC3F18A44DB0925467A1D2395F568D6D@exsrv3.workskillsprofessionals.com.au> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200608/150 X-Sequence-Number: 22693 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* >