Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 0DF572E004C; Thu, 22 Nov 2007 09:46:28 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 72859-03; Thu, 22 Nov 2007 09:46:23 -0400 (AST) Received: from mailhost.ics.forth.gr (mailhost.ics.forth.gr [139.91.157.55]) by postgresql.org (Postfix) with ESMTP id D890C2E0051; Thu, 22 Nov 2007 09:46:22 -0400 (AST) Received: from mailhost.ics.forth.gr (mailhost.ics.forth.gr [139.91.157.55] (may be forged)) by mailhost.ics.forth.gr (8.13.8/ICS-FORTH/V10-Server-2.0.0) with ESMTP id lAMDkJUe028942; Thu, 22 Nov 2007 15:46:19 +0200 X-DKIM: Sendmail DKIM Filter v2.3.2 mailhost.ics.forth.gr lAMDkJUe028942 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ics.forth.gr; s=mailhost; t=1195739179; bh=T768Kc6JIbJMViFb1cM3o6jIPYYlngmklfXlak 5//JM=; h=X-AuditID:From:To:Cc:Subject:Date:MIME-Version: Content-Type:Content-Transfer-Encoding:X-Mailer:In-Reply-To: X-MimeOLE:Thread-Index:Message-Id:X-Brightmail-Tracker; b=jK/aQj7Y OK+Zr8G+bZ0EmvAYx6nIf0TZ6sMq8/R/0hh6zscG7ynd1c++YNnnqJZNdnyXBwqXpvX iR8N0IIl97fCqvtUuA2v0gLySXIiSXQblPVGzR3P9gTes75IsnZmHv6WR1RfQZGb8VU LiZruB7SfIFn9dfRz8g1HuOU3Xc/M= Received: from sappho.ics.forth.gr (unknown [127.0.0.1]) by mailhost.ics.forth.gr (Symantec Mail Security) with ESMTP id F12A716C090; Thu, 22 Nov 2007 15:46:18 +0200 (EET) X-AuditID: 7f000001-a86c9bb000001a55-4a-4745882a0b73 Received: from SHADOWFAX (unknown [139.91.183.33]) by mailhost.ics.forth.gr (Symantec Mail Security) with ESMTP id 80DF18E40FC; Thu, 22 Nov 2007 15:46:18 +0200 (EET) From: "Sorin N. Ciolofan" To: "'Marco Bizzarri'" Cc: , Subject: Re: backup of postgres scheduled with cron Date: Thu, 22 Nov 2007 15:46:15 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: <3f0d61c40711220528k32a69464j6d37c584b8e93484@mail.gmail.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Thread-Index: AcgtDJyW5Ql2LOjCSHGyZi0f2B6jFQAAUnGA Message-Id: <20071122134618.80DF18E40FC@mailhost.ics.forth.gr> X-Brightmail-Tracker: AAAAAA== X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/193 X-Sequence-Number: 27436 Hi Marco! Thank you for the advice. I got: /home/swkm/services/test/backup.sh: line 4: pg_dump: command not found updating: mydb_dump_22-11-07.out (stored 0%) which seems strange -----Original Message----- From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Marco Bizzarri Sent: Thursday, November 22, 2007 3:28 PM To: Sorin N. Ciolofan Cc: pgsql-admin@postgresql.org; pgsql-general@postgresql.org Subject: Re: [ADMIN] backup of postgres scheduled with cron On Nov 22, 2007 2:19 PM, Sorin N. Ciolofan wrote: > Hello all! > > I've a small bash script backup.sh for creating dumps on my Postgre db: > > #!/bin/bash > time=`date '+%d'-'%m'-'%y'` > cd /home/swkm/services/test > pg_dump mydb > mydb_dump_$time.out > > I've edited crontab and added a line: > > 00 4 * * * swkm /home/swkm/services/test/backup.sh > > to execute the backup.sh as user swkm daily at 4 am. > > The user swkm is the user I use to create backups manually. The script > itself is executed fine if run manually but run on cron scheduler I got an > mydb_dump_$time.out file empty (of 0 kb) > > Do you have any idea about what's wrong? > > Thanks > Sorin > Hi Sorin, why don't you add a "MAILTO=" at the start of your crontab file, so that you can receive a report of the problem? Regards Marco -- Marco Bizzarri http://iliveinpisa.blogspot.com/ ---------------------------(end of broadcast)--------------------------- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate