X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 727709FB2FA for ; Thu, 10 Aug 2006 16:03:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 64963-02 for ; Thu, 10 Aug 2006 19:03:43 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 2560C9FB2F8 for ; Thu, 10 Aug 2006 16:03:41 -0300 (ADT) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Thu, 10 Aug 2006 19:03:40 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 10 Aug 2006 14:03:40 -0500 Subject: Re: pg_dump from crontab From: Scott Marlowe To: Nirav Parikh Cc: pgsql-admin@postgresql.org In-Reply-To: <221385EC3F18A44DB0925467A1D2395F568D6D@exsrv3.workskillsprofessionals.com.au> References: <221385EC3F18A44DB0925467A1D2395F568D6D@exsrv3.workskillsprofessionals.com.au> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1155236620.20252.167.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Thu, 10 Aug 2006 14:03:40 -0500 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=SPF_PASS, UNPARSEABLE_RELAY X-Spam-Level: X-Archive-Number: 200608/146 X-Sequence-Number: 22689 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.